Elevate modern apps with TiDB.
Started in 2013, Bolt is an on-demand mobility company, supporting 100 million users across 500 cities. Bolt is at the center of private mobility in the EMEA region. The company offers services across ride sharing, local delivery, and vehicle rental. Recently valued at $8.4 billion, Bolt has experienced 400% growth since the pandemic, making it the fastest growing company in Europe.
The Challenge: Rethinking Application Development and Deployment for Microservices
For starters, adding a column in their MySQL database could take up to a week on a loaded 1 terabyte (TB) table. To scale with the business, they had to rethink development, deployment, and how to scale their applications.
AWS and Kubernetes were instrumental in their scaling challenges. However, you can’t scale a database technology (MySQL) when it is not architected to do so—not at Bolt’s scale. Operating and maintaining their MySQL databases with fast-changing new microservices became “a waking nightmare.”
Additionally, to support its millions of customers, the company has incredibly high expectations for system uptime and disaster recovery. But again, their MySQL database was too fragile to survive disasters. That means they would occasionally lose data, even though they deployed a multi-master cluster like Galera to enhance the system’s availability.
The Problem: Scaling, Operating, and Maintaining Legacy MySQL
Bolt had been a heavy MySQL shop for some time. The company used it as its main database. However, as the business expanded, MySQL was unable to keep up with the increasing workload. In short, the database had become difficult to scale, operate, and maintain.
Today, Bolt’s engineering team operates thousands of microservices, 400+ schema, several hundred TBs of data, all on AWS. Business growth has pushed the engineering team to the limit, while the operational burden continued to accumulate around managing scalability and availability.
The Solution: Modernizing MySQL with Horizontal Scaling and Strong Consistency
Bolt needed a database solution that could scale dynamically on both reads and writes while providing strong consistency. To accommodate their agile development teams, they also needed a solution that was open source and integrated with their data pipeline built on Apache Kafka.
To ease their operational burden, they wanted a relational database architected for AWS. With a global customer base, their database has to have zero downtime during maintenance and upgrade windows. Finally, their required solution also had to provide exceptional cost efficiency.
Bolt spent quite a bit of time exploring new solutions. Vitess was at one point a strong contender. However, it turned out that this database clustering system required too many changes to Bolt’s applications—all while having similar operational issues to MySQL. Additionally, Vitess had limited MySQL compatibility.
Why Did Bolt Choose TiDB?
After much testing, Bolt decided on modernizing MySQL with TiDB, an advanced open-source distributed SQL database for the most demanding modern applications. They chose TiDB for the following reasons:
- 100% Open Source: TiDB has been an open source database since its inception. Every line of code is transparent, which means Bolt can modify and customize the code according to their needs.
- Limitless horizontal scalability: TiDB has almost infinite horizontal scalability. By automatically adding or removing storage nodes, it can easily handle up to hundreds of terabytes of sudden data spikes or plunges. Even better, TiDB’s architecture separates compute from storage. This allows Bolt to control their database and operation costs.
- Strong data consistency: TiDB uses the Raft consensus algorithm to ensure that data is highly available and safely replicated throughout storage via Raft groups. TiKV is TiDB’s key-value storage server that copies data between storage nodes. It then places them in different Availability Zones (AZs) to protect against machine or data center failure.
- Automatic failover and disaster recovery: Modernizing MySQL with TiDB provides automatic failover to ensure system uptime. Additionally, TiDB offers a choice of multiple disaster recovery solutions, each of which applies to different scenarios with flexible costs.
- MySQL wire compatibility: This made it easy for Bolt’s engineering team to migrate data to TiDB, saving both time and money. TiDB also provides built-in integration tooling with Kafka and Kubernetes while running on AWS.
- Multi-cloud and cloud-native: TiDB works in the cloud, on-premises, or in hybrid environments. It takes full advantage of the scalability and elasticity of the cloud. TiDB’s cloud-native capabilities allow users to scale as needed to meet changing business needs.
The Results: Modernizing MySQL for Added Elasticity and Exceptional Cost Efficiency
One of the technical wins the Bolt team highlighted: They saw an average compression rate of 3 when migrating their data from MySQL to TiDB. This means 3 TBs of data on a MySQL database becomes 1 TB after migrating to TiDB due to optimized storage while experiencing higher availability and resiliency. On top of that, they can now run TiDB on AWS ARM64 for better price performance.
As of October 2022, Bolt has deployed seven TiDB clusters storing dozens of TBs of data and hundreds of schemas:
- Four TiDB clusters are running balance, billing, ordering, and internet of things (IoT) microservices.
- Two TiDB clusters are Alpha and Beta clusters for development or pre-production.
- One TiDB cluster is a downstream cluster deployed in Stockholm for disaster recovery.
“We leverage TiDB today as the store of record for our most critical applications, including microservices supporting order creation, commerce, and payment processing,” said Boris Savelev, Senior Engineering Manager at Bolt. “On average, we are processing 35K QPS on TiDB. TiDB gives the engineering team the confidence to scale effectively and efficiently on AWS, and the performance and consistency needed serving a global customer base.”
Not only was moving to TiDB necessary to scale with the business, it gave Bolt the ability to scale their cluster flexibly across a range of AWS compute & storage services (EC2, S3, EBS, NVMe, local storage, in the future EKS). TiDB’s distributed architecture also allows Bolt to take advantage of the granularity of Amazon EC2 instance types. This allows them to architect their applications for elasticity and cost efficiency.