Move fast and don’t break things: The best database for gambling apps

Last edited on December 8, 2021

0 minute read

    Online gambling is one of the fastest-growing industries on the planet, with the market expected to be worth more than $127 billion by 2027. But it’s also a very challenging vertical for app development.

    What makes gambling so challenging?Copy Icon

    Users have sky-high performance expectations for gambling apps. Because real money – sometimes a lot of it – is involved, even short delays that might be tolerated in other apps can upset gambling app users. Outages will make many of them furious, and can seriously harm the brand’s reputation.

    For example, when Fanduel suffered an outage on the final day of the NFL regular season last year, many users vented their frustrations publicly on Twitter, in some cases talking about how much money they’d lost, and discussing switching to competing services. That’s brand damage that’s difficult to undo.

    So, gambling applications need to offer high availability and high performance to keep customers happy. But both of those things can be difficult to achieve at scale, and gambling applications often require tremendous scale. Sports betting platform Bet365, for example, handles more than 2.5 million concurrent users and processes more than half a million transactions per second during peak usage.

    All of this might suggest that it makes sense for gambling app developers to play it safe so they can ensure all of their services are rock-solid, scalable, and performant. But no gambling platform can afford to move slowly or stagnate.

    For example, the explosion of “micro betting” – quick in-app bets on small events, like the result of the next pitch in a baseball game – has helped motivate sports broadcasters such as NBC Sports to invest in the gambling market.

    The result is an increasingly lucrative and also increasingly competitive marketplace. In this environment, user brand loyalty is relatively low, and innovation is happening fast. Companies that don’t innovate quickly can find themselves left behind.

    Where the database fits inCopy Icon

    The challenges inherent in operating an online gambling application affect the decisions made at every layer of a company’s tech stack. But in the case of gambling applications, the database holds a special position, for a couple of reasons:

    First, the nature of the database is inherently important to a gambling app. Statistics, odds, bets, account balances, and other mission-critical data live in the database. The speed at which it can process transactions and retrieve data is a major factor on how responsive (or laggy) the user experience is.

    Second, the database is an area where developers can save or lose quite a lot of time. If building scalable, highly available database infrastructure means manually sharding a Postgres database, for example, or investing a lot of time in database ops, that’s time that developers can’t spend building new features.

    So, is it possible to get the performance and availability that gambling apps require from the database layer without saddling them with extra ops and infrastructure work?

    In a word, yes. Let’s take a look at one specific solution, CockroachDB, and how it offers gaming and gambling app developers high availability, high performance, and best-in-class ease of use.

    To illustrate how it can work, let’s imagine a new betting service that’s going to go from ideation all the way to production, and how the right database technology can make that process easier.

    1. Move fast…Copy Icon

    There’s (unfortunately) no database that can generate brilliant new feature ideas for you. But once you do have an idea, CockroachDB Serverless makes it easy to develop an MVP and start testing by essentially taking all of the database work out of the equation.

    Spinning up a new cluster and getting it connected to your app takes less than five minutes, and it’s completely free. You don’t even have to enter a credit card. And because even free users are guaranteed a minimum performance of 100 Request Units per second, you can test your new idea with real users and workloads, without fear that it’ll go offline or run up a massive server bill.

    As a distributed SQL database, CockroachDB Serverless uses SQL, so you don’t have to learn anything new, or figure out how to convert transaction syntax you’ve already got into a proprietary query language. You write your application using your language of your choice, and connect it to the database via your preferred driver (we support a lot of them).

    Basically, you can treat CockroachDB Serverless like a regular single-instance Postgres database.

    2. …and don’t break anythingCopy Icon

    CockroachDB Serverless may be as easy to use as a single-instance Postgres database, but it’s far more powerful. CockroachDB is inherently a distributed database, and on Serverless your data is automatically replicated and distributed to ensure the database is highly available.

    CockroachDB Serverless also auto-scales. You can build your feature and get it up and running without worrying about how many servers you need or when to expect heavy usage. When the users come, your database will scale up to meet the workload automatically.

    At the same time, you also don’t have to worry that a sudden spike in users will blow up your budget: paid users set a monthly resource limit, so you can rest assured your bill will never go higher than that.

    3. Go globalCopy Icon

    CockroachDB Serverless is great for building, testing, and scaling up new features. At some point, though, it may make sense to switch to a dedicated platform that you have a bit more control over.

    Thankfully, it’s really easy to move from CockroachDB Serverless to CockroachDB Dedicated. They’re just two different versions of the same database, so very little needs to change in your code. And since CockroachDB Dedicated is also a managed service, you get a similar low-ops experience that allows your team to keep their focus on development.

    Why might you want to switch from Serverless to Dedicated? There are many potential reasons. In some cases, it may be more affordable, or you may require enterprise-level support, for example. But one reason that’s particularly relevant to gambling companies is that CockroachDB Dedicated supports multi-region deployments and data geo-partitioning all the way down to the row level. (CockroachDB Serverless will ultimately also support these features, but as of this writing it is still in beta and does not).

    Multi-region deployment makes it easier for gambling apps to provide a great experience to users no matter where they are in the world by allowing you to store a user’s data on the node closest to their physical location. It also makes regulatory compliance easier because it allows you to create rules that define where in the world any given user’s data can or cannot be.

    4. Stop worryingCopy Icon

    Ultimately, what any gambling app needs is a database that offers high performance, high availability, and high flexibility while still remaining low maintenance. That’s a difficult needle to thread, but it’s possible, and it’s why CockroachDB is already trusted by gaming and gambling companies such as Hard Rock Digital.

    You can have a hands-off database that still delivers high availability and blazing-fast performance all over the world. And you can start building and testing with it right now. Spin up a free cluster and see for yourself!