[CASE STUDY]

Stash Logo White@2x 1

Stash for a better life:Building a highly available banking infrastructure

stash-app
Eight years ago, Stash founders Brandon Krieg and Ed Robinson had a hunch that Americans wanted to invest, but they didn’t know how or where to start. While working on Wall Street, they took to the streets, asking New Yorkers if they invested in the stock market. The common refrain: “No, but I want to.” People of different backgrounds considered investing to be too expensive, intimidating, and complicated.

Stash was born from this experiment with a mission to empower people to invest and build better lives. Today, Stash’s investing app does exactly that for 2 million active subscribers. Stash’s plans — which start at just $3 a month — provide simple, cost-effective access to a suite of simple, automated solutions designed to give people the access they need to improve their lives through investing.

In 2022, the company launched its new back-end infrastructure, Stash Core, along with major updates to its managed portfolio product, Smart Portfolio, and its investing tools. Building a new banking infrastructure from scratch is a massive undertaking — especially with an aggressive GTM timeline. The Stash team knew they had to select the right foundation and partner with the right company. Enter CockroachDB.
Stash Logo Midnight@2x 1
Why Stash built their banking infrastructure on CockroachDB

[ INDUSTRY ]

Fintech


[ CHALLENGE ]

Achieving five-nines of availability and delivering an ideal customer experience


[ SOLUTION ]

A highly available bank built on CockroachDB

ACTIVE SUBSCRIBERS

2 Million

ASSETS MANAGED

3 Billion

AVAILABIITY

100 %

Risk mitigation with multi-region, multi-cloud

When Stash engineers started designing their new banking infrastructure, they built an initial design on PostgreSQL while also integrating a wide variety of partners for other capabilities. (One massive benefit of its new back-end infrastructure is the ability to integrate best-of-breed technologies for many different use cases). When they started building, a lot of the engineers were already familiar with PostgreSQL and knew that it delivered data consistency and a resilient foundation, which are both crucial capabilities for handling money.

However, a mission-critical banking platform has two other important requirements: 1) achieving five-nines of availability and 2) building on a multi-region, multi-cloud foundation. They never wanted their customers to worry about incorrect balances or run into latency issues when spending money. Looking to the future, it also made sense for Stash to build a platform that could easily scale to multiple regions and replicate data across those regions for an even better fault-tolerant setup.

While these requirements are technically possible with PostgreSQL, they’re complicated to set up and even harder to maintain. One of the Principal Engineers on the project suggested taking a look at CockroachDB, a cloud-native distributed database that met their requirements:

  • High availability (99.999%)

  • Guaranteed data consistency

  • Ability to scale across multiple regions and multiple clouds

  • Easy, horizontal scale (no manual sharding required)

Stash started building on CockroachDB core (the free, open-source version) and found the transition from PostgreSQL to be seamless. Once they were ready to implement their initial design, they requested an enterprise license so they could access certain CockroachDB features, such as backups and the capability to extend across multiple regions.

quote

“There’s a lot of databases out there on the market. However, on paper, CockroachDB met all of our requirements to build a highly available platform. We felt like we were making an informed decision about our tech stack, and CockroachDB truly lived up to the expectations that it promised.”

-Michael Swendener,Senior DevOps Engineer

Source of Truth

Though the Stash Core project took years to implement in full, Stash’s GTM timeline for this aspect of the new banking infrastructure was a compact six months. After the development phase, the team reports that they had “no issues getting into production with CockroachDB.” After a successful soft launch in September 2022, they opened the platform up to all customers in December 2022.

CockroachDB serves as a system of record (or source of truth) for the entire banking infrastructure. It processes and stores all types of mission-critical workloads, including banking data, customer data, PII, accounting info, and more.

Right now, Stash is self-hosting CockroachDB in a single AWS region and plans to expand out to four regions in the near future. They’re running a multi-region cluster now to test its functionality before moving into production. As mentioned above, running your application across multiple regions and multiple clouds is a great approach when designing fault-tolerant systems and reducing risk for your business.

Stash also uses Kubernetes alongside CockroachDB. Since CockroachDB and K8s have the same distributed principles, they work well together and make it easier for engineers to build distributed applications.

quote

”CockroachDB is our source of truth… It stores everything for our banking partner. When building a mission-critical application, we wanted to choose the right technologies that would guarantee our customer’s data would never be at risk. CockroachDB lived up to its expectations that it promised.”

-Jordan Larrigan,Engineering Manager

stash-app-2

Support system

While Stash’s engineering team already had PostgreSQL experience and felt comfortable making the decision to build on CockroachDB, they had to execute at a rapid pace without hiring additional engineers.

According to the Stash team, one of CockroachDB’s biggest differentiators is the support they offered. That included weekly calls and several training sessions that helped get the Stash developers up to speed. If they ever run into any trouble, they could quickly pop questions into the shared Slack channel or get their enterprise architect (CEA) on a call.

Not only was it great to have immediate access to a CEA, but it also gave the Stash team peace of mind. After all, they were building a tier 0 application that would be handling a customer’s money. They simply couldn’t afford any hiccups with so much at risk.

quote

“The support we received from the Cockroach Labs team saved us a tremendous amount of hours during the development cycle. We didn’t have to hire extra people to help us execute at a really fast pace. The support we received and the confidence we felt made a massive difference.”

-Jordan Larrigan,Engineering Manager

What’s next

As Stash moves into a multi-region setup, they’ll continue to take advantage of CockroachDB’s advanced features. The engineers are already eager to see what they can do better and faster.

Stash is available in the US market now, but international expansion could be in the future. When you build on a multi-region, multi-cloud foundation, it becomes substantially easier to grow your business into new regions.

Stash’s immediate focus is to empower their customers to feel confident as they begin their investing journey, and today, the pioneering fintech is ready to deliver.

Ready to get started?

Go hands-on with 100% free CockroachDB Serverless. Spin up your first cluster in just a few clicks.

cta-bg