AWS ElastiCache for Redis Replication Modes
ElastiCache for Redis offers two replication modes, each catering to different use cases and scalability needs. Understanding these modes is essential for optimizing data storage, availability, and performance.
1\. Cluster Mode Disabled
- Configuration:
- One primary node.
- Up to five replica nodes (0-5 replicas).
- Sharding:
- Single shard containing all data.
- Replication:
- Asynchronous replication between the primary node and replicas.
- Read/Write Operations:
- Primary node handles both read and write operations.
- Replica nodes are read-only.
- Scaling:
- Horizontal Scaling: Adding or removing replica nodes.
- Vertical Scaling: Upgrading to larger or smaller node types.
- Availability:
- Multi-AZ (Availability Zone) support is enabled by default for failover capabilities.
- Use Cases:
- Suitable for disaster recovery.
- Enhances read performance through read replicas.
2\. Cluster Mode Enabled
- Configuration:
- Data partitioned across multiple shards (Shard 1, Shard 2, ..., Shard N).
- Each shard can have one primary node and up to five replica nodes.
- Sharding:
- Enables scaling of write operations by distributing data across shards.
- Replication:
- Similar replication model as Cluster Mode Disabled, but applied across all shards.
- Scaling:
- Supports Auto Scaling to automatically adjust the number of shards or replicas.
- Up to 500 nodes per cluster, with the exact number depending on the replication setup.
- Availability:
- Multi-AZ capability for failover between primary and replica nodes across shards.
- Use Cases:
- Ideal for scenarios requiring high write scalability.
- Partitioning (sharding) is key for distributing data efficiently.
Auto Scaling with Cluster Mode Enabled
- Features:
- Supports Target Tracking and Scheduled Scaling Policies.
- Utilizes metrics (e.g., CPU utilization) to adjust the cluster size dynamically.
- Configuration Endpoint:
- A single endpoint is used for all read and write operations, simplifying application integration.