hazelcast-读取备份数据与近缓存 [英] hazelcast - read-backup-data vs near cache

查看:162
本文介绍了hazelcast-读取备份数据与近缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IMap配置中,可以将属性read-backup-data设置为true,如果密钥的所有者是其他成员,则该成员可以从备份副本中读取值(如果可用).

In IMap configuration there is an attribute read-backup-data that can be set as true which enables a member to read the value from the backup copy, if available, in case the owner of the key is some other member.

http ://docs.hazelcast.org/docs/latest-development/manual/html/Distributed_Data_Structures/Map/Backing_Up_Maps.html#page_Enabling+Backup+Reads

然后有Nearcache,它将开始本地缓存一些数据结构的结果.

Then there is nearcache which will start caching results for a few datastructures locally.

http://docs.hazelcast .org/docs/latest-development/manual/html/Performance/Near_Cache/Hazelcast_Data_Structures_with_Near_Cache_Support.html

如果我们有两种集群设置:

If we have 2 kinds of cluster setup:

  1. 2成员,而地图的async-backup-count1read-backup-datatrue
  2. 2成员,为此地图启用了近缓存
  1. 2 members, and async-backup-count for a map is 1, and read-backup-data is true
  2. 2 members, nearcache enabled for this map

这两种方法是否会有区别?

Would there be differences in these 2 approaches?

第一次设置可能会使用更少的内存,并且将无法配置.但是在阅读性能方面?

1st setup will probably use less memory, and will not be configurable. But in terms of read performance?

推荐答案

用于两个成员群集设置;启用备份读取将使您能够本地访问所有数据,因为这两个成员都将所有条目保存为主或备份.此设置与使用复制地图没有太大区别(有关详细信息,请参见此处:

For two member cluster setup; enabling backup reads will provide you to access all the data locally, since both members hold all the entries as either primary or backup. This setup is not much different than using a Replicated Map (see here for details: http://docs.hazelcast.org/docs/latest-development/manual/html/Distributed_Data_Structures/Replicated_Map.html). So; when your cluster have only two members (also no clients), enabling backup reads can be more advantageous in terms of performance.

但是; Near cache具有许多配置选项,您可以决定在任何类型的设置(包括客户端-服务器拓扑)中需要本地访问多少数据.您还可以决定近缓存中的内存中数据格式.与启用备份读取相比,这些选项可以为您提供更高的性能.

However; near cache has a bunch of configuration options, and you can decide how much data you need to access locally at any type of setup (including client-server topology). You can also decide the in-memory data format in near cache. These options can provide you more performance than enabling backup reads.

这两个选项在单项读取性能上没有太大不同(我认为接近缓存包含有效项),因为这两个选项都不执行远程操作.

Both options are not so much different in single entry read performance (I assume near cache contains valid entry), since both don't perform a remote operation.

这篇关于hazelcast-读取备份数据与近缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆