简体   繁体   中英

Amazon ElasticCache for Redis with Node.js server

I am using Redis in my Node.js application. I don't use it for caching and I don't want to. I want my data in the Redis to be persistent at any point. Also my every call to redis write to the disk. Is it helpful to use the Amazon elastic cache in such case? Because I understand that Amazon elastic cache handles standby replication and automatic failover which is very important to me. I am running my Node.js server on Amazon EC2. Any help or suggestion would be appreciated.

Currently Amazon ElasticCache's way for keeping a persistent state is through snapshotting which means it uses the Backup and Restore feature to keep a copy in an S3 bucket that you can use for loading your data again in the case of losing it or warming up a new instance.

The backup and restore feature uses BGSAVE in the background , and as a heavy operation on your instance if setup to be done periodically , it is recommended to be running on a read replica.

So to answer your question; I do not think Amazon ElasticCache is a solution for your problem. it was meant for solutions who are looking for a cache layer to scale/speed up lookups for their apps that are running on other storage engines.

Update: As a manually setup alternative (taken from the comments)

If you are opened to setting up your own instance of Redis cluster redis.io/topics/cluster-spec that will be your best bet, it takes care of AFO, and replication, with persistence options enabled as append only file or backing up to RDB files

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM