Maciej Ceglowski created Pinboard in 2009 “partly out of frustration with a redesign of Delicious that I felt removed a lot of utility from the site, and partly because I had long wanted to have a boomarking site that would archive my bookmarks,” according to the About page. Since then, the site has become a popular alternative to Delicious and Ceglowski is now able to make a living on it.
Pinboard runs entirely on a traditional LAMP stack, and it runs amazingly fast. We talked with Ceglowski about the Pinboard architecture and his development process.
The Pinboard about page says: “There is absolutely nothing interesting about the Pinboard architecture or implementation; I consider that a feature!”
Can you explain why you think that’s a feature?
I believe that relying on very basic and well-understood technologies at the architectural level forces you to save all your cleverness and new ideas for the actual app, where it can make a difference to users.
I think many developers (myself included) are easily seduced by new technology and are willing to burn a lot of time rigging it together just for the joy of tinkering. So nowadays we see a lot of fairly uninteresting web apps with very technically sweet implementations. In designing Pinboard, I tried to steer clear of this temptation by picking very familiar, vanilla tools wherever possible so I would have no excuse for architectural wank.
The other reason I like the approach is that the tried-and-true stuff is extensively debugged and documented. The chances of you finding a bug in MySQL or PHP as the author of a mid-sized website are microscopic. That’s not the case for newer infrastructure like NoSQL or the various web frameworks.
I was actually poking around trying to find out exactly what technology Pinboard used because it was so incredibly fast. With so much interest in cutting edge technologies like Scala, Node.js and MongoDB it’s easy to forget that traditional tools, used correctly, can yield exceptional performance. Do you have any optimization tips for developers using a traditional LAMP stack?
The following come to mind, in no particular order:
- Take advantage of the fact that it’s 2011 and you can load servers up with RAM.
- Use a RDBMS and take the time to learn it very thoroughly. High-Performance MySQL (the O’Reilly Book) and the Percona blog are indispensible for MySQL; I’m sure similar resources exist for Postgres.
- Use dedicated (not virtualized) hardware. I/O can be awful on virtualized servers and debugging I/O slowness there is next to impossible.
- Use caching as a last resort, not as a fundamental design strategy. It’s 2011 – unless you have millions of users, your app should be able to run fast with all caches disabled.
- Use frameworks for prototyping, but build from the ground up once you know what you’re building.
- Resist excessive abstraction
- Set performance targets for yourself. For example, one goal for Pinboard is a median page load time of under a third of a second. This will force you to instrument well and optimize appropriately.
What is the development process for Pinboard like? Do you use Agile methodology?
My development process is quite primitive. I run a local copy of the site on my laptop, test changes manually, check them in, and then deploy to the production server. The only similarity to agile development is the use of frequent small deployments.
One interesting quirk of Pinboard is a complete absence of unit tests. I used to be a die-hard believer in testing, but in Pinboard tried a different approach, as an experiment. Instead of writng tests I try to be extremely careful in coding, and keep the code size small so I continue to understand it.
I’ve found my defect rate to be pretty comparable to earlier projects that included extensive test suites and fixtures, but I am much more productive on Pinboard.
Do you work on Pinboard for a living?
Yes, it’s my full-time job.
What were you doing before Pinboard?
I was a contractor, working mainly on search and recommendations engines for Rails-based startups.
How many developers work on Pinboard?
I do all the coding. My girlfriend helps with invoicing and localization, and Peter helps with ops and feature design.