A sports betting app saved millions switching from PostgreSQL to CockroachDB

A sports betting app saved millions switching from PostgreSQL to CockroachDB
[ Guides ]

1 Report. 7 Companies. Millions in savings.

Download Report

The challenges facing sports betting platforms are rigorous: they have to be fast and consistent in a way that’s similar to high-frequency trading platforms. At the same time, they have a variety of data-locality requirements to comply with depending on which states or countries they serve.

In this blog, we’ll look at a real-world example of a North America-based sports betting platform with 100–500 employees that designed a gaming and sports betting architecture that not only meets the performance, consistency, and compliance requirements of the industry; but also enabled the business to swiftly enter new regional markets without requiring a massive engineering effort.  

Data locality and The Wire Act

Sports betting services in the U.S. must comply with The Wire Act, which mandates that betting data must be processed within the geographical boundaries of the state in which the bet was placed. To build a multi-region online sportsbook that complied with The Wire Act regulations, this company planned to use AWS Outposts so that the infrastructure for each state where their betting platform operates would run physically within that state. 

This approach led to the larger challenge of finding a way to avoid operating a separate physical database in each state because running siloe’d databases adds both great expense and great complexity to application architecture. When thinking about the application complexity keep in mind that real-money gaming requires a real-time processing engine that can support millions of concurrent users who are placing bets at the same time which puts enormous pressure on the database.

How to meet compliance requirements in multiple states with one database

“What Cockroach has given us is the ability to meet each state’s regulatory environments à la carte…No matter which states we launch or how many nodes or clusters we add, it is still just one database." - Head of Technology. 

Choosing CockroachDB allowed the company to use a single database to help the company meet compliance regulations in every state. With CockroachDB they’re able to have a database gateway node in each state where they do business, and easily add new states as their coverage grows. Because CockroachDB functions as a single logical database, the application is able to talk to nodes in each respective state and use geo-partitioning to ensure data remains properly domiciled. 

CockroachDB also natively supports the hybrid infrastructure (i.e., AWS cloud regions and Outposts servers) the company created to help satisfy The Wire Act regulations. And, because CockroachDB automatically scales horizontally, it can handle the influx of transactions from high-demand events like the Super Bowl without taking a performance hit. 

“The operational simplicity of being able to meet compliance regulations in multiple states with a single logical database — this is everything we could ask for in a database. And not just the database itself, but also the support the Cockroach Labs team has consistently provided is so great. They worked with us in setting up the environment we required for our complicated, specific use case and have been here to guide us every step of the way." - Head of Technology

Savings, speed, and simplified scaling with CockroachDB

1. Engineering talent: Scaling into new markets

“We had been looking at hiring 5 to 10 new technical headcount for each state that we launch in, compared to doing what we are doing now — which is zero per new state.” - Head of Technology

Hiring engineers is really, really hard. This report from LinkedIn found that it took, on average, 49 days to hire an engineer - that’s almost two months. Even if you’re able to hire for multiple open heads concurrently, it’s still a massive lead time. That’s money lost.

This company reported an astonishing 98% faster time to market for entering new regions with CockroachDB’s built-in data domiciling capabilities.

“With our original PostgreSQL database, we were looking at two months to set up an outpost in state, plus hiring five to 10 new technical headcount for each state launched, in order to comply with Wire Act regulations. And we are going nationwide. Compare that to what we are doing now with CockroachDB, where adding a new state is as simple as adding a new node or cluster and no engineering effort.” - Head of Technology

If they had stayed with the PostgreSQL database they would have needed to hire an average 7.5 FTEs per state. Their application is currently available to users in four states, meaning the company has thus far avoided the need to hire approximately 30 staff augments, for an average estimated savings of $1,507,500 in FTE costs per state, or $6,030,000 overall.

2. FTE savings: Lean and agile operations

Choosing CockroachDB over Amazon RDS PostgreSQL (which the company also initially evaluated) allowed them to keep their tech team lean and agile. “Our entire technology team is about 50 people including project management, executive leadership, etc. We want to stay lean. With PostgreSQL, we would have needed to add between 10-20 engineers.” Their estimated (midpoint) annual operations FTE savings is $3,930,000.

3. Faster product development velocity

Less than a year after the initial launch, this net-new application is now available in four states and will become available in two more states by mid-2023.

4. Truly unique product differentiation that better serves customers

No other sports betting application has the ability for a user to move from state to state and place wagers with the guaranteed ability to process in-state betting data, to help comply with The Wire Act. This ability is made possible by CockroachDB’s unique multi-regional data-homing capabilities.

5. Savings on software services

The company was able to eliminate additional software services that were in use for replicating and moving data because these capabilities are built into CockroachDB. This cut out the cost of these services and further simplified their technology stack.

Further Reading

If you want to read more about how CockroachDB fits with real-money gaming applications or with related financial services workloads like payment processing check out the following resources:

About the author

Michelle Gienow github link linkedin link

Michelle Gienow is a recovering journalist turned front end developer based in Baltimore, MD. She creates content around her central obsessions: Jamstack, distributed architecture and developing a cloud native mindset.

Keep Reading

Live betting on ACID: Challenges of building a next-gen gambling app

Imagine you’re watching a baseball game. In the middle of the fifth inning, your pitcher throws a strike, and then …

Read more
How TreesPlease Games builds gaming infra with CockroachDB Serverless

The gaming industry is all about delivering a great end-user experience which means building relationships with players …

Read more
The history of databases at Netflix: From Cassandra to CockroachDB

In 2008, after Netflix pivoted from DVD-by-mail to streaming, they were running the streaming service on premise and …

Read more