Solution for transferring data from one redis to another redis in a different AWS account.

0

Hi Team, We need a solution to transfer data from Redis one account to another Redis in a different account. Lets say Redis-A is a production account and we are going to migrate the date in to Redis-B will be the new production account. The requirement is to have the data in sync till we decommission the Redis-A prod account. Any suggestion would be very helpful Thank you.

1 Answer
1

When moving Redis data between AWS accounts, there are a few strategies you could consider. The key to choosing the right strategy will be in balancing your needs for availability, consistency, and operational complexity.

  • AWS Data Migration Service: AWS DMS supports Redis as a source for migration but it does not support Redis as a target for migration. However, you can still use DMS to migrate data to another supported target database in the new account, and then export from there to the new Redis instance.

  • Master/Replica Replication: One common strategy would be to set up the new Redis instance as a replica of the old one. Redis has built-in support for replication where you can set up Redis-B as a replica of Redis-A. The replica will automatically stay in sync with the master. Once you're ready, you can promote the Redis-B to be the new master and update your applications to use it. However, Redis replication across different AWS accounts can be tricky as it requires network connectivity between the two instances which might need VPC peering or VPN setup between two AWS accounts.

  • Manual Backup/Restore: Another strategy is to take periodic backups of the Redis-A database using the BGSAVE command or the snapshot feature, transfer those backup files to the new AWS account (perhaps using S3), and then restore them on the new Redis-B instance using the redis-cli --pipe command. This would not keep the data in sync, but it would allow you to periodically update Redis-B with the data from Redis-A.

  • Custom Sync Service: If the built-in replication doesn't work for you, and you need a more real-time solution than manual backup/restore, you might need to build a custom solution. This would involve writing a service or script that listens for changes on Redis-A (either by polling or by using the Redis Keyspace Notifications feature) and then immediately applies those changes to Redis-B.

Please note that moving data between AWS accounts, especially for a database like Redis that doesn't support cross-account data operations directly, might require significant work and carry some risk. I'd recommend carefully testing whatever strategy you choose before doing the final switchover. Also, make sure you have recent backups of all important data in case something goes wrong.

profile picture
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions