Navigation

Cash App case study

Cash App's move to PlanetScale resulted in streamlined database operations, improved performance, and reduced operational overhead.

PlanetScale's team has very deep knowledge of how Vitess, MySQL, and AWS work, and were tremendously effective in coming up with solutions to some of the more esoteric issues we encountered. We have very strict regulatory requirements that can feel painful to the average engineer, however PlanetScale was a strong partner in grinding through our asks, leaving us in a place where everyone was happy.

Aaron Young, Engineering Manager


Background

With Cash App, the #1 finance app in the App Store, anyone can easily send, spend, or invest their money in stocks or Bitcoin. Launched in 2013, the company’s growth and success has been nothing short of incredible.

The importance of Cash App’s database infrastructure

Cash App's two largest systems — one responsible for managing customer and payment history data, and the other for its main financial ledger—operate on large Vitess clusters. As a fintech provider, ensuring the availability, scalability, and reliability of its systems is vital to maintain the best customer experience. The performance and stability of the underlying database infrastructure are key drivers for ensuring smooth operations, especially in a high-demand environment with millions of daily transactions.

The transition from self-hosted Vitess to PlanetScale has been instrumental in meeting these demands while simplifying operations and supporting future growth across Cash App’s parent company — Block.

Pain points prior to migrating to PlanetScale

Prior to moving to PlanetScale, Cash App operated a self-hosted Vitess cluster within its own data centers. The Vitess clusters were heavily sharded, with customer tokens serving as the primary sharding key. The system had reached around 400 shards to manage the growing data volume. Prior to adopting Vitess, Cash App relied on two large MySQL clusters, which had quickly reached capacity, necessitating multiple splits after migrating to Vitess.

The key challenges Cash App faced with its self-hosted setup included:

  • Scaling limitations: Managing the database at scale required constant software upgrades, a time-consuming process that often lagged behind the rapid growth of data and upstream Vitess features.
  • Operational complexity: Vitess had to be deployed on top of the existing MySQL infrastructure, rather than in a more streamlined Kubernetes environment, which resulted in manual, time-consuming and error-prone processes.
  • Maintenance burden: The team had to maintain a forked version of Vitess to support their custom setup, which became increasingly difficult as Vitess evolved to favor Kubernetes deployments.

These issues underscored the need for a more scalable, managed solution.

Why PlanetScale

The decision to move to the cloud and leave behind Cash App’s in-house data centers marked a pivotal moment. The operational overhead of scaling in the data center environment became difficult as data demands continued to grow.

Around the same time, PlanetScale began offering a fully-managed database platform that runs Vitess under the hood, which presented a timely opportunity for Cash App to offload database management while still leveraging the power of Vitess.

Since database operations are not our core competency we explored the managed option, and happily PlanetScale proved to be extremely knowledgeable and responsive to our needs.

Aaron Young, Engineering Manager

Migrating off of Vitess would have introduced significant risk to Cash App’s core business operations, but it was clear that managing database operations was not the most efficient way the team could be spending their time. PlanetScale’s managed services could provide the expertise and operational support needed to minimize risks.

Several factors made PlanetScale the ideal partner:

  • Proven expertise: PlanetScale's deep knowledge of both Vitess and AWS infrastructure reassured Cash App that they could handle the complex migration and ongoing operations.
  • Flexibility and scalability: PlanetScale’s cloud offering provided the flexibility to scale easily without the need for time-consuming hardware upgrades or manual operations.
  • Regulatory compliance: PlanetScale worked closely with Cash App to ensure all of their strict regulatory requirements were met during the migration process.

PlanetScale's team has very deep knowledge of how Vitess, MySQL and AWS work, and were tremendously effective in coming up with solutions to some of the more esoteric issues we encountered. We have very strict regulatory requirements that can feel painful to the average engineer, however PlanetScale was a strong partner in grinding through our asks, leaving us in a place where everyone was happy.

Aaron Young, Engineering Manager

Migration and cutover process

The migration from Cash App's self-hosted Vitess clusters to PlanetScale was treated with the same care and precision as a typical Vitess shard split operation. The migration involved extensive planning and coordination across Cash App internal teams and PlanetScale’s engineering staff. The process was complex due to the number of internal systems, but Cash App’s prior experience with Vitess, combined with PlanetScale’s Vitess expertise, allowed for a smooth transition.

One notable challenge during migration was the potential for increased latency from straddling cloud and data center environments. PlanetScale addressed this by deploying custom infrastructure to minimize latency and ensure a reliable and fast experience for Cash App customers during the transition. Thanks to this and the comprehensive migration plan, the cutover was executed with minimal disruption to users.

The actual cutover was almost comically boring, which is exactly where I wanted to be after all the upfront work we put in.

Aaron Young, Engineering Manager

Cash App on PlanetScale

At peak times, Cash App's database handles approximately 3–4 million queries per second (QPS) across 400 shards, totaling around 400TiB of data. Since moving to PlanetScale, Cash App has benefited in several key areas:

  • Reduced operational overhead: By offloading the management of Vitess clusters to PlanetScale, Cash App no longer has to maintain their bespoke, self-hosted infrastructure, freeing up valuable time and resources for their teams to focus on more strategic initiatives rather than day-to-day database management.
  • Improved performance: With the right hardware configurations from the start, the database infrastructure has been more stable, with fewer performance spikes during peak loads.
  • Enhanced developer experience: Product engineers appreciate the insights and metrics provided through PlanetScale’s dashboard, which offers Vitess-specific details for diagnosing and optimizing queries.

In the past we've had issues when something unusual happens on a specific shard, resulting in spiked CPU and poor performance, and since migrating we haven't really seen instances of this, speaking to PlanetScale choosing the correct hardware for our existing load at the outset.

Aaron Young, Engineering Manager

PlanetScale support and expertise

PlanetScale’s support team was an invaluable resource throughout the migration and continues to provide best-in-class support for ongoing database management. The PlanetScale team demonstrated a deep understanding of Cash App's unique technical requirements, which enabled them to provide solutions or alternative approaches to effectively address the challenges posed by Cash App's complex and unique workload.

PlanetScale support is always extremely quick to help when we have an issue. This might be an ask to dig into performance on a particular cluster, or a feature request needed to work around a specific issue…Some of our requests can be pretty odd, given that we have a pretty odd workload, and they'll think about them deeply to either come up with a solution or suggest an alternate path.

Aaron Young, Engineering Manager

An ongoing partnership

By moving to PlanetScale, Cash App has successfully streamlined its database operations, improved performance, and freed up internal resources to focus on innovation and development. PlanetScale continues to be a partner for Cash App, providing the expertise, performance, and scalability necessary to support its complex and growing database needs.

← Back to all case studies

Your business deserves a predictable database

Never worry about another 3am wake-up call saying the site is down. Give your engineers the power they deserve with a PlanetScale database today.

Get started Contact sales