简体   繁体   English

分布式缓存架构

[英]distributed Cache Architecture

In my application, I am getting feeds(in the form of XML). 在我的应用程序中,我正在获取提要(以XML的形式)。 I need to push these feeds to memcached. 我需要将这些提要推送到memcached。 The feed expected to last for 24 hours. 该Feed预计将持续24小时。 The reason being, there are some matching process need to happen on this cache. 原因是,此缓存上需要进行一些匹配过程。 My problem is if the Cache server crashes, all my data is lost. 我的问题是,如果缓存服务器崩溃,我的所有数据都会丢失。 I can't retrieve it. 我找不到它。 I am thinking to have a messaging queue, so that the feed comes first to messaging queue and then flows to Memcached Server. 我正在考虑有一个消息传递队列,以便提要首先到达消息传递队列,然后流到Memcached Server。 So that even if the cache server crashes, the data is still with messaging queue. 这样,即使高速缓存服务器崩溃,数据仍然带有消息传递队列。

Is this is a better solution and there can be a better solution to it. 这是一个更好的解决方案吗?可以有一个更好的解决方案。

Regards, Debasish 问候,Debasish

Message queue guarantee delivery of messages in FIFO order, in general. 通常,消息队列可确保按FIFO顺序传递消息。 The queue will discard the message (and should) once the client responds with a success status. 一旦客户端以成功状态响应,队列将丢弃消息(并且应该)。 So, it cannot be used as persistent store. 因此,它不能用作持久性存储。

You need a persistent store like database to back up the messages and load them into the cache during failure recovery phase. 您需要像数据库这样的持久性存储来备份消息并将其在故障恢复阶段加载到缓存中。

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

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