简体   繁体   English

Amazon ElasticCache for Redis与Node.js服务器

[英]Amazon ElasticCache for Redis with Node.js server

I am using Redis in my Node.js application. 我在Node.js应用程序中使用Redis。 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. 我希望Redis中的数据在任何时候都是持久的。 Also my every call to redis write to the disk. 另外,我对redis的每次调用都会写入磁盘。 Is it helpful to use the Amazon elastic cache in such case? 在这种情况下使用Amazon弹性缓存是否有帮助? Because I understand that Amazon elastic cache handles standby replication and automatic failover which is very important to me. 因为我知道Amazon弹性缓存可以处理备用复制和自动故障转移,这对我来说非常重要。 I am running my Node.js server on Amazon EC2. 我正在Amazon EC2上运行Node.js服务器。 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. 当前,Amazon ElasticCache保持持久状态的方法是通过快照 ,这意味着它使用备份和还原功能将副本保存在S3存储桶中,在丢失或预热新实例的情况下,您可以使用该副本再次加载数据。

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. 备份和还原功能在后台使用BGSAVE ,并且如果要定期进行设置,则对实例执行繁重的操作,建议在只读副本上运行。

So to answer your question; 因此,回答您的问题; I do not think Amazon ElasticCache is a solution for your problem. 我认为Amazon ElasticCache不能解决您的问题。 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 如果您愿意设置自己的Redis集群redis.io/topics/cluster-spec实例,这将是最好的选择,那么它将处理AFO和复制,并启用了持久性选项,即仅追加文件或备份到RDB文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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