Pinterest engineers Yashwanth Nelapati and Marty Weiner recently shared some insights and lessons learned while developing and scaling the company.
Pinterest is a site for collecting and sharing photos of interesting objects around the web.
In a little over three years, Pinterest has grown from zero page views a day to billions per month. The most recent tally: 3.4 billion monthly page views from its 25 million members worldwide.
Today, Pinterest is valued at $2.5 billion following a $200 million financing round earlier this year.
This slideshow talks about the software and hardware Pinterest used to get where it is today. Warning: It’s for geeks only!
Pinterest uses Amazon EC2/S3 for a few reasons. The main one: you can have new instances ready in a matter of seconds.
Open source database MySQL has proven to be solid choice for Pinterest. It's incredibly mature and you can hire for it, as lots of engineers know MySQL.
Pinterest realised that during its rapid growth, it needed to spread the data evenly to handle the load. So they defined a spectrum of options between clustering and sharding.
But sharding is a completely manual data placement process. It's used to separate databases into smaller, faster, and more manageable data pieces called shards.
If there's a massive bug, it will impact every single node. A SPOF brought down Pinterest four times.
If your project has a few terabytes of data, you should shard as soon as possible. When Pinterest's Pin table reached one billion rows, the indexes ran out of memory. That's when the company decided to shard.
With an increased load on a database, Pinterest replicated a server to handle some of the data nodes.
Since Pinterest is on AWS and MySQL queries took about 3 milliseconds, they decided to build the location into the ID.
If Pinterest has 50 IDs, for example, they split them up and run them in parallel. This is what Pinterest's lookup/rendering structure looks like.
How Pinterest brings up a user profile. Most of the calls are served from the cache (Memcache or Redis)
Pinterest built a huge scripting farm to move 500 million Pins and 1.6 billion follower rows. Scripting is what happens when you need to move from the old, unsharded system to the sharded one.
NOW WATCH: Ideas videos
Business Insider Emails & Alerts
Site highlights each day to your inbox.