Scaling to Meet Hyper User Growth
The Lyft app went live in summer 2012 and the team did not look back. The service struck a chord with the public, who embraced Lyft’s ideal of fewer cars on the road and rewarded friendly, safe drivers for using their vehicle’s extra capacity. As Lyft grew, they faced a variety of interesting problems. They needed to:
- Innovate, test, and create new features to better align with customer needs
- Scale to manage terabytes of data
- Accommodate very large spikes in traffic
And they needed to do all this while never, ever, going down. Optimizing and monitoring database performance became critical in enabling Lyft to achieve their goals.
mLab’s tools and expertise help Lyft optimize and scale their database
New features were frequently tested and added to the application, which meant introducing new queries into the database workload. mLab’s slow query analyzer would ensure that new queries were optimally indexed by monitoring the database logs for any long-running queries. If the analyzer identified any slow queries, an index recommendation would be sent to the Lyft team.
Lyft also experienced massive database growth that could only be served by scaled horizontally. mLab helped transition Lyft’s larger databases from a replica set architecture to a sharded architecture with no downtime, which meant there was no impact for end users. Once the sharded architecture was in place, Lyft could seamlessly scale their databases by simply adding shards to the deployment.
On April 24, 2014, Lyft launched in 24 cities in one day without a hitch - a proud accomplishment for both Lyft and mLab.
Live sharding without downtime was a big deal for us. With MongoDB sharding, we can scale without any downtime by simply adding a new shard. mLab’s service made this transition very easy and smooth for us.
Lyft was also one of the early adopters of mLab’s new private networking solution called Private Environments. Private Environments allow Lyft to create a network peering connection between their application infrastructure and their mLab databases to create an extended private network isolated from the rest of AWS. This private network keeps Lyft’s infrastructure secure and makes it easy for the engineering team to manage network security in sophisticated ways that were previously unachievable.