Digital bank Nubank migrates to CockroachDB for horizontal scaling & high availability | Cockroach Labs
skip to Main Content

Case Study

Digital bank Nubank migrates to CockroachDB for horizontal scaling & high availability

Nubank migrated its credit card authorization service from in-memory storage to CockroachDB to achieve scalable, always-on infrastructure, and more efficient operations

Nubank, the leading financial technology company in Latin America, sought a distributed SQL database for several critical services. The fintech company initially stored data on-prem using an in-memory data store, but as the business rapidly grew, it needed a transactional solution for some applications.

Nubank’s Financial Ledger Database Requirements:

  • Reduce Operational Complexity – Increase Developer Productivity
  • Horizontal Scale with High-Level Consistency
  • Always-On Services
  • Hybrid-Cloud Deployment  

International Business Growth Forces New Database Infrastructure 

NuBank is a Latin American digital bank with headquarters in Brazil. Founded in 2013, it quickly grew to become the highest valued private digital bank in the world, with over 12 million customers. As Nubank’s business grows and its customer base expands into Argentina, Mexico, and other countries, it must also evolve its application architecture. The digital bank built the first iteration of its infrastructure with Java Heap using an in-memory data store. However, this infrastructure was operationally complex and poorly scalable.

“We have a highly complex transaction environment where we are continually searching for simplicity, scalability, and robustness,” 

-Gabriel Melo, Engineering Manager 

The Nubank team decided they needed a transactional SQL database and began evaluating options. Their goal was to migrate one service at a time, starting with their authorization app. 

CockroachDB Meets Nubank’s Requirements for Financial Ledger Workload

After researching and comparing Cassandra, CouchDB, and CockroachDB Nubank’s team decided that CockroachDB’s combination of consistency and scalability provides the best foundation for Nubank’s credit card authorization system and for their future expansion.

ACID Transactions

CockroachDB was built to support transactional workloads like Nubank’s financial ledger. It achieves strong consistency and guarantees the highest level of isolation (serializable isolation). At the same time, CockroachDB scales automatically. Data is broken into 64-megabyte chunks called ranges that distribute and balance across nodes. If a user wants to add an additional node, he or she simply spins it up and points it at the cluster. Nubank has initially deployed CockroachDB on-prem in three locations, and if they choose to migrate to the cloud, CockroachDB’s flexibility and scalability will allow them to seamlessly transition.

High Availability

Resiliency is also built into CockroachDB, helping Nubank achieve the always-on service it requires. CockroachDB replicates all ranges three times and stores the replicas in a way that maximizes geo-diversity. The replicas are spread across nodes of a cluster, which together forms a single logical database. Depending on the cluster’s topology and how many machines and regions are involved, the replicas could be located across multiple regions, data centers, machines or all of the above. This replication ensures survival in the event of failure.

Familiar SQL Syntax

In addition, CockroachDB increases the productivity of Nubank’s developer and infrastructure teams. Its standard SQL interface, which is PostgreSQL wire compatible, allows developers to communicate easily with the database. The infrastructure team has benefitted from CockroachDB’s automated backups, automated garbage collection, and rolling upgrades. These features give them more freedom to focus on tasks like maintaining the hardware of their on-prem servers.

Read the full case study to learn about Nubank’s technical requirements and challenges as well as how they decided to grow with CockroachDB. 

You're in Good Company

Lorem ipsum dolor sit amet about CockroachDB Labs

Additional Resources

Learn how to use

Need help? Get answers on the CockroachDB forum

What are you building with CockroachDB?

Back To Top