首页 > 解决方案 > 用于 Ignite 的自定义 CacheStore 是否会自动进行后写?

问题描述

我已经为 Ignite 实现了一个自定义 CacheStore 来与 Elastic Search 进行通信。现在,如果 ElasticSearch 服务器宕机一段时间,缓存中的数据会在 ES 服务器启动后上传到 Elastic Search 吗?

标签: elasticsearchignitejcache

解决方案


用于 Ignite 的自定义 CacheStore 是否会自动进行后写?

不。默认情况下禁用:https ://apacheignite.readme.io/docs/3rd-party-store#section-configuration

setWriteBehindEnabled(boolean) | Sets flag indicating whether write-behind is enabled. | false

现在,如果 ElasticSearch 服务器宕机一段时间,缓存中的数据会在 ES 服务器启动后上传到 Elastic Search 吗?

不会。Ignite 不会再次发送该数据。它也在文档中指定:

Performance vs. Consistency
Enabling write-behind caching increases performance by performing 
asynchronous updates, but this can lead to a potential drop in consistency as 
some updates could be lost due to node failures or crashes.

推荐阅读