Scaling Redis Without Clustering

Redis is a popular in-memory data store known for its speed and flexibility. It operates efficiently when a particular workload's memory and computational demands can be managed within a single node. However, scaling beyond a single node often leads to the consideration of the Redis Cluster. There's a common assumption that transitioning to the Redis Cluster is straightforward and existing applications will behave the same, but that's not the case in reality. While Redis Cluster addresses certain scaling issues, it also brings significant complexities. This post will discuss the limitations of scaling with Redis Cluster, and introduce some simpler alternatives that may meet many organizations' needs.

What Is the Redis Cluster?

Redis Cluster is a distributed implementation that allows you to share your data across multiple primary Redis instances automatically and thus scale horizontally. In a Redis Cluster setup, the keyspace is split into 16384 hash slots (read more here), effectively setting an upper limit for the cluster size of 16384 master instances. However, in practice, the suggested maximum size is on the order of ~1000 master instances. Each master instance within the cluster manages a specific subset of these 16,384 hash slots. To ensure high availability, each primary instance can be paired with one or more replica instances. This approach, involving data sharding across multiple instances for scalability and replication for redundancy, is a common pattern in many distributed data storage systems. A cluster having three primary Redis instances, with each primary instance having one replica, is shown below:

What You Need to Know About ElastiCache Serverless

At AWS re:Invent 2023, ElastiCache Serverless was announced. This continues the trend of databases offering a serverless service, so understandably, there is excitement from both the Redis and serverless communities. It's not surprising that in-memory data stores are the last ones to go serverless. Creating a true serverless experience for sub-millisecond data stores is extremely complicated, as data must remain in memory even when there is no traffic at all.

So, how did AWS pull it off? How did they create a serverless offering for a service that must remain up at all times? And which use cases is ElastiCache Serverless a good fit for? The answer to those questions can be found in the service pricing model.