
Cross-Region Replication for ElastiCache Redis in Hyderabad Using RIOT
Setting up cross-region replication for Amazon ElastiCache Redis using RIOT, focusing on Hyderabad.
Dr. Rahul Gaikwad
Amazon Employee
Published Feb 22, 2025
Last Modified Feb 24, 2025
Amazon ElastiCache for Redis is a popular choice for caching and session management in high-performance applications. However, as per AWS documentation Global datastores or cross-region replication for ElastiCache Redis in the Hyderabad (
ap-south-2
) region is not available yet. This limitation poses a challenge for Indian financial services institutions (FSI) that require a disaster recovery (DR) setup with real-time replication across regions to meet compliance and business continuity requirements.As a workaround solution, we can use Redis Input/Output Tools (RIOT), an open-source tool designed for Redis replication across different regions. RIOT can be used to replicate ElastiCache Redis data from one AWS region to another region where cross-region replication is available.

You can perform migration in two different ways:
- One-time (snapshot) migration
- Online (live) migration
The replication process involves the following steps:
- Identify Source Keys: Use scan and/or keyspace notifications to identify keys for replication, depending on the chosen replication mode.
- Read Key Data: Retrieve data associated with each key using dump or type-specific commands.
- Write to Target: Write each key to the target database using restore or type-specific commands.
Replication Mode begins by identifying the keys to be replicated from the source Redis database. The
--mode
option lets you specify how RIOT identifies these keys:- Scan Mode: Iterate over keys using a key scan (
--mode scan
) - Live Only Mode: Receive keys via a keyspace notification subscriber (
--mode liveonly
) - Live Mode: Use both methods (
--mode live
)
- AWS ElastiCache
- An Amazon EC2 instance to run RIOT
- Deploy an Amazon ElastiCache for Redis cluster in the Mumbai (
ap-south-1
) region. - Deploy a destination Redis cluster in Hyderabad (
ap-south-2
) region where DR setup is required.
- Launch an Amazon EC2 instance in Mumbai region that will act as the RIOT replication server.
- Ensure that the instance has access to both the source and destination Redis clusters.
- Connect to the EC2 instance and install
redis-cli
sudo apt update
sudo apt install -y redis-tools
- Test the connectivity with ElastiCache
redis-cli -h <elasticache primary endpoint> -p 6379
- On EC2, download the pre-compiled binary from RIOT Releases.
- After download, uncompress it and copy to the desired location.
- Run the following command to start replication:
riot replicate source:port target:port --source-cluster
- RIOT validates the replication by matching keys from the source to the target database.
- Verification step happens automatically or can also be run on-demand
riot compare SOURCE TARGET [OPTIONS]
- Cross-region replication introduces network latency, which may impact real-time workloads.
- Performance tuning is required to optimize replication speed.
- RIOT performs asynchronous replication, which may lead to minor delays in data propagation.
- Ensure periodic consistency checks between source and destination Redis clusters.
- Enable VPC peering or use AWS Transit Gateway for secure connectivity between regions.
- Use TLS encryption for Redis endpoints to secure data in transit.
- Regularly audit logs and replication metrics for compliance requirements.
- Implement monitoring with CloudWatch to detect replication failures.
- Define an automated failover strategy in case of primary region failure.
- Automate RIOT deployment using AWS Systems Manager or any IaC.
- Monitor replication metrics using AWS CloudWatch and set up alerts.
- Evaluate AWS Global Datastore for ElastiCache once available in Hyderabad.
- Consider using Amazon ElastiCache for Valkey if a fully managed cross-region replication is a priority.
- Increase Parallelism - Use the
--threads
option to increase the number of parallel threads for data processing. - Batch Processing - Use the
--batch
option to group operations into batches, reducing network overhead. - Pipelining - Enable pipelining with the
--pipeline
option to send multiple commands in a single request. - Cluster Mode - Enable
--cluster
mode to distribute data across multiple nodes for parallel processing.
While Global datastore or cross-region replication for ElastiCache Redis is not available in Hyderabad, RIOT can provides a viable alternative for setting up DR replication. However, organizations should carefully evaluate latency, security, and failover strategies before deploying this solution.
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.