Introducing Dragonfly Cloud! Learn More

Question: How can I scale up an ElastiCache instance?

Answer

Scaling up an Amazon ElastiCache instance involves increasing the capacity of your cache cluster. This could mean adding more nodes to a cluster, or scaling vertically by selecting a larger node type.

There are two ways to scale up your ElastiCache for Redis:

  1. Vertical Scaling You can change the node type to a larger one using the AWS Management console, AWS CLI, or SDKs. Please keep in mind that the scaling operation replaces existing nodes with new nodes and may lead to some downtime.

Here's an example of how to do it using AWS CLI:

aws elasticache modify-cache-cluster --cache-cluster-id my-cluster --cache-node-type cache.m4.large --apply-immediately
  1. Horizontal Scaling (adding or deleting read replicas) You can add or remove read replicas at any moment without any downtime. This is helpful when you want to handle more read traffic.

Here's a AWS CLI example of adding a replica:

aws elasticache create-replication-group --replication-group-id my-replica-group --replication-group-description "my replication group" --primary-cluster-id my-cluster --automatic-failover-enabled

For removal, use this:

aws elasticache delete-cache-cluster --cache-cluster-id my-read-replica

Before making these changes, you should consider your application requirements, load balancing needs, and cost implications.

For ElastiCache for Memcached, vertical scaling (changing node type) is the only option as it doesn't support horizontal scaling (adding or removing nodes).

Was this content helpful?

White Paper

Free System Design on AWS E-Book

Download this early release of O'Reilly's latest cloud infrastructure e-book: System Design on AWS.

Free System Design on AWS E-Book

Start building today 

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.