Technical: How Coinbase Handled Scaling Challenges on Their Exchange

Editorial & Review Staff

Editorial & Review Staff

Editorial & Review Staff articles have been checked and revised.

Share This Post

Note: This article is quite technical and oriented for coders.

Coinbase, a digital currency exchange, faced scaling challenges on their platform during the 2017 cryptocurrency boom. The engineering team focused on upgrading and optimizing MongoDB, traffic segregation for hotspots to resolve them, and building capture and replay tools to prepare for future surges.

Customer traffic spiked to higher than the anticipated levels at Coinbase during May-June 2017, exceeding 5 times the typical maximum traffic and causing downtime. The team attacked the easy issues first – vertical scaling, upgrading MongoDB for performance improvements, index optimization and traffic segregation based on hotspots. The existing monitoring system was not enough to identify contextual information, so it was augmented with code instrumentation that logged the missing data. Even with these improvements, during the December 2017 Bitcoin price surge, Coinbase faced multiple outages again. The team has since focused on ensuring their systems can handle higher amounts of traffic by emulating traffic patterns with capture and replay tools.

Both Coinbase’s Ruby app and MongoDB experienced higher latencies during the initial outages, with the time split equally between Ruby and MongoDB. To better understand the context of these calls across different components, the team logged additional data by modifying MongoDB’s database driver. This helped them narrow down the issue to an unoptimized response object which increased the network load. Fixing this issue gave the application a performance boost. Additionally, large read throughputs were speeded up by adding caching based on Memcached at the Object Relational Mapping (ORM) layer as well as in the driver layer. Adding missing indices also improved the response times. By June 2017, the team had upgraded their MongoDB clusters to 3.2 which had the faster WiredTiger storage engine. Coinbase uses Redis to implement services like rate limiting, which were affected due to Redis‘s single threaded model during these outages.

To prepare for future surges in traffic, the team has worked on tools called Capture and Cannon that can capture traffic from production systems and replay it on demand against new systems to test their resilience. Capture and Cannon are both based on mongoreplay, which is a tool that can capture traffic to MongoDB instances from the network interface, and record the commands being invoked. This log can then be replayed against another MongoDB instance. Traffic is captured across multiple application servers and merged into a single file. The captured traffic as well as a disk snapshot is stored on AWS S3, from where Cannon plays it back later.

Coinbase maintains a public status page at

If you enjoyed this article please share it for others to read

Articles reflect the author's own opinion.

In any circumstances can CCG be responsible for potential losses regarding investments or services, either referenced by the author in the article itself or by any links provided.

This platform is intended to share educational knowledge, open for several external author's and in no way represents any financial advisement.

Editor Note

One Response

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Articles

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore


Revolution of DeFi in the Finance Industry

Decentralization Finance (DeFi), which has gained prominence in cryptocurrencies, is a resistance movement. Users can avoid paying exorbitant costs and borrow money while earning interest

Do You Want To Boost Your Business?

Send us a Press Release or article about your business

Have a new token to present? Some interesting project that uses blockchain? Or maybe one idea you'd like to write about? Share it to the world here.