Return to all case studies

Case Study

mLab Helps Lyft Navigate the Road from Startup to Ridesharing Juggernaut

As ridesharing becomes a preferred mode of transportation across U.S. cities, Lyft turns to mLab for faster product deployment, smooth scaling to multi-million monthly rides, and expansion into new markets.

  • When Lyft first began, they selected mLab as their database solution because it enabled them to get up and running quickly.
  • mLab helped Lyft upgrade to a sharded architecture with no downtime, which was instrumental in scaling the platform to support millions of rides a week.
  • Private Environments from mLab allows Lyft to create an extended private network consisting of their application and database infrastructure.
Customer Profile

Lyft was founded in June 2012 by Logan Green and John Zimmer to reconnect people and communities through better transportation. Lyft is the fastest growing rideshare company in the U.S and is available in more than 200 cities. Lyft is preferred by drivers and passengers for its safe and friendly experience, and its commitment to affecting positive change for the future of our cities. From Lyft’s inception – and throughout its tremendous growth – the transportation network company has relied on MongoDB as its primary database technology and leveraged mLab as its trusted database hosting platform.

This is the story of how Lyft has leveraged mLab’s database service to rapidly scale from the ridesharing network’s experimental beginnings to its speedy expansion to taking the business to the global stage – and the technical challenges overcome along the way.

Challenge #1

Re-architecting for a Mobile-first World

Prior to Lyft’s founding in 2012, the company operated as Zimride (from 2007-2012) and provided a ridesharing service that facilitated carpooling between cities. Over that five-year span, growth was modest and the team expanded from a single engineer to six.

A breakthrough came in 2012 when the company held an internal hackathon with the goal of re-imagining ridesharing in a mobile-first world. A couple engineers came up with an exciting new prototype and were tasked with shipping a new app in just a few weeks.

Lyft chooses mLab’s Database-as-a-Service to enable rapid development

The Zimride engineers chose mLab’s cloud-hosted MongoDB platform as their database solution because it enabled them to get up and running quickly. The developers could create new production-ready database deployments in just a few clicks. All the best practices and tools for running MongoDB were automatically bundled into mLab’s plans. Features like mLab’s battle-tested backup system gave Lyft’s engineers peace of mind and was crucial in allowing them to focus on creating the app instead of implementing and auditing their own backup system.

The Zimride team also wanted to use this prototype as an opportunity to modernize their stack; Zimride was built using PHP and SQL. They chose Python as their new server-side language and MongoDB as their primary database technology. Moving to MongoDB allowed Zimride to take advantage of features like rich document structures, built-in geospatial support, simple high availability, and easy horizontal scaling. As development progressed, Zimride was fully confident in adopting MongoDB as their primary data store because of mLab’s MongoDB database solution.

In just three weeks, the Zimride engineers shipped their new application and Lyft was born.

To go from an idea to a public launch as quickly as Lyft did, our engineers relied on emerging platforms and technologies to preemptively solve a lot of would-be problems for us. mLab helped us prototype and get our new service to market in a very compressed timetable. We didn’t have the time or resources to become ops experts, but mLab’s platform and support were able to fill those gaps.

Chris Lambert CTO, Lyft

Challenge #2

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.

Chris Lambert CTO, Lyft

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.

Challenge #3

Bringing Lyft to a Global Audience

Lyft celebrated its one millionth ride about a year after launching. Growth has accelerated even more since then: three years later, Lyft is serving millions of riders every week. The company now has global aspirations, having forged strategic partnerships with General Motors, Didi Kuaidi, GrabTaxi, and Ola. These companies cover nearly all of Southeast Asia, India, China, and the United States (cumulatively reaching nearly half of the world’s population). Joint products with these partners will further challenge the Lyft engineering team to support their expanding user base and provide new users with the same smooth experience that their customers have relied on.

We’ve been with mLab since the very beginning and haven’t looked back. They have continued to deliver an outstanding fully managed Database-as-a-Service platform and we have enjoyed working with their world-class support team.

Chris Lambert CTO, Lyft

As Lyft continues to scale globally they know that mLab will help them meet the demanding infrastructure needs of one of the most complex and rapidly growing operations on the planet.

More Case Studies
View all case studies