services
A holistic approach that accelerates your current vision while also making you future-proof. We help you face the future fluidically.
Digital Engineering

Value-driven and technology savvy. We future-proof your business.

Intelligent Enterprise
Helping you master your critical business applications, empowering your business to thrive.
Experience and Design
Harness the power of design to drive a whole new level of success.
Events and Webinars
Our Event Series
Featured Event
08 - 10 Oct
Fira Barcelona Gran Via, Barcelona
Our Latest Talk
By Kanchan Ray, Dr. Sudipta Seal
video icon 60 mins
About
nagarro
Discover more about us,
an outstanding digital
solutions developer and a
great place to work in.
Investor
relations
Financial information,
governance, reports,
announcements, and
investor events.
News &
press releases
Catch up to what we are
doing, and what people
are talking about.
Caring &
sustainability
We care for our world.
Learn about our
initiatives.

Fluidic
Enterprise

Beyond agility, the convergence of technology and human ingenuity.
talk to us
Welcome to digital product engineering
Thanks for your interest. How can we help?
 
 
Author
Vaibhav Sharma
Vaibhav Sharma
connect

In the high-stakes world of sports betting and iGaming, speed and reliability are paramount. However, behind the scenes, developers grapple with common issues like performance and scalability. Distributed caching solves these issues, ensuring a seamless user experience. Good caching solutions include Memcached, Redis, Hazelcast, CouchDB, and Aerospike. While each has specific use cases, our experience shows that Redis is a versatile and effective solution for most scenarios.

What is Redis?

Redis (Remote Dictionary Server) is an open-source, in-memory data structure store often used for caching, session storage, and real-time analytics. It supports various data types, such as strings, lists, sets, sorted sets, hashes, bitmaps, and more. It offers high performance, atomic operations, and persistence options.

Caching solutions: Why choose Redis?

Let us understand what makes Redis stand out:
  • Superior performance: Redis is renowned for its ultra-low latency and high throughput. Benchmark results show that it can handle millions of requests per second with a sub-millisecond response time.
  • Rich data structures: Redis’s rich data structures, from simple string, hash, sets, and lists to advanced sorted sets, bitmaps, empower you with a versatile toolset. This versatility covers specific iGaming use cases such as using sorted sets, to simplify gaming leaderboard implementation.
  • Easy integration and deployment: With extensive documentation and straightforward APIs (Application Programming Interfaces), Redis ensures smooth integration and effortless deployment, whether on-premises or in the cloud.
  • Rich community support: Redis has a large and active community, ensuring that issues are quickly reported and resolved. This strong support network also builds trust among users.

Sports betting and iGaming: Redis use cases

The sports betting and iGaming industry can harness the power of Redis to implement the following use cases:

Real-time odds calculation

Redis’s fast in-memory storage facilitates rapid calculation and updates of betting odds based on live sports events. Dynamic, real-time odds are crucial during live sports events. These high-level steps can be followed to achieve the same:

  • First, input real-time data (e.g., scores, game states, player statistics, etc.) from the live stream into the Redis store. You may use Redis stream or Kafka for streaming purpose.
  • Next, trigger an odds-calculation script for this data. We may also use Redis Lua scripts here to enhance performance, as it runs within Redis.
  • Finally, store the newly calculated odds in a Redis Hash data structure, allowing your sports betting application to quickly access and display them to players.

Session Storage

Redis ensures efficient player session management with fast data retrieval and updates. To achieve horizontal scalability in a Distributed Architecture, sports betting backend APIs need to be stateless. However, player-specific session information still needs to be stored. Traditionally, this session data was kept in memory on the application server, tightly coupling player state with the server and limiting scalability. Redis provides a solution by storing player session state externally using its hash data structure. You can build highly scalable systems that support seamless horizontal scaling by leveraging Redis Cluster or managed Redis services.

Nagarro successfully completed a discovery phase for an iGaming client, recommending a migration to Redis for session storage and caching to enhance application scalability.

Caching

Using Redis as a cache reduces latency and enhances performance by storing frequently accessed data, such as user profiles, game stats, and bet histories. This would reduce the load on the database, speeding up the data access.

We partnered with an iGaming client to successfully implement the Protobuf serialization and Brotly compression for Redis cache. This reduced memory usage and increased performance.

Leaderboards

The Sorted-Set data structure in Redis is ideal for maintaining live leaderboards in betting apps and online casinos. It allows quick updates and retrievals to ensure players always see the latest standings. A Sorted Set can hold the player details with corresponding scores, which could be points, wins, or any other desired metrices. A Sorted Set automatically maintains the ordering of details based on score. So, no manual intervention is needed to maintain order when displaying player ranks on the leaderboard.

Real-time notifications

With Redis Pub/Sub messaging, sports betting platforms can send real-time notifications to players about game updates, bet results, and promotional offers, keeping users engaged and informed.

Let us now delve deeper into Redis and explore its latest licensing challenges.

What is the problem or challenge with Redis?

When considering the use of Redis in your organization, a thorough evaluation is essential, especially following the recent open-source BSD license change announcement in March 2024.

On March 20, 2024, Redis announced a move from the BSD license to the more restrictive RSALv2 and SSPLv1 licenses (For more details, refer to Redis Licenses on the Redis website). While this change primarily affects Redis product/service Redistributors (mainly cloud service providers offering managed Redis services), you can still use Redis for free if you comply with the new license conditions. However, this shift raises concerns about the consistency of Redis's support for its free offering, including updates, features, and improvements.

What is the solution?

Here are some viable options:
Redis solution-illustrationFree Open Source (Self-Hosted)

Following the Redis license change announcement, a fork named Valkey was created from the Redis 7.2.4 open-source branch. Valkey is backed by industry giants like AWS (Amazon Web Services), GCP, Oracle, Ericsson, Snap, and hosted by the Linux Foundation. This backing gives hope that Redis, in the form of Valkey, will remain a free and open-source product.

You can start with the Redis OSS stack version 7.2.4 or earlier. Redis has promised to continue supporting its OSS stack as a community edition. However, if you encounter issues with Redis upgrades and community support, you can switch to Valkey since it is based on Redis 7.2.4. Please note that Valkey’s documentation is still evolving.

We recommend starting with the Redis OSS stack, only if you are committed to transitioning to Valkey for a truly open-source solution. Given Redis's history, there may be potential compatibility issues between Redis and Valkey in future versions; we never know.

Managed Services (Paid)

Redis company offers Redis Cloud as managed service where it provides the features and support of Redis Enterprise product suite as serverless offering. Redis Cloud provides hosting options in collaboration with AWS, Azure, and GCP. Not all the cloud vendors hosting is available in all the regions. Before taking a decision on which cloud to go with, it’s good to check the Redis Cloud Supported Regions (For more details, refer to Supported Cloud providers and regions on the Redis website).

Other options for cloud-managed services
  • AWS Elasticache: Based on Redis OSS, AWS Elasticache offers both serverless and self-designed cluster options. With AWS being a primary sponsor of Valkey following the Redis license change, it's anticipated that AWS will soon migrate its service internally to Valkey.
  • Azure Cache for Redis: This managed service by Azure Cloud is supported by Microsoft's contract with Redis, post-license change. Azure will continue to support both the OSS and Enterprise versions of Redis, ensuring seamless upgrades.
  • GCP Memorystore: Like AWS Elasticache, GCP Memorystore is a managed service. As a key sponsor of Valkey, GCP is expected to eventually migrate its services to Valkey, though Google has not made any public statement yet.

End note

Redis remains a powerful caching solution to help with specific use cases of sports & iGaming industry. While the BSD license change has raised concerns within the open-source community, there are still several options available for leveraging this platform effectively:

  • You can continue using Redis OSS but with caution and vigilance, or
  • Consider transitioning to Valkey, though it may be wise to wait for it to mature or
  • Opt for managed services like Azure Cache for Redis, outsourcing operational management to the vendor, or
  • Although the most expensive option, you could move to the commercial Redis Cloud solution if the additional services and features align with your use cases.

 

We at Nagarro, have been helping our customers with their digital journeys, consulting on the best strategy and technology solutions and implementing them. Let’s talk to understand your unique needs and drive your business forward.