What is the best way to work with collections (lists or collections) in a keystore?

Interestingly, what could be an effective way to add / remove items from a really large list when your storage is memcached-like? Maybe there is a distributed repository with a Java interface that handles this problem well?

Someone might recommend Terracotta. I know about this, but this is not quite what I need.;)

+3
source share
3 answers

Hazelcast 1.6 will have a distributed implementation of MultiMap, where the key can be associated with a set of values.

MultiMap<String, String> multimap = Hazelcast.getMultiMap ("mymultimap");
multimap.put ("1", "a");
multimap.put ("1", "b");
multimap.put ("1", "c");
multimap.put ("2", "x");
multimap.put ("2", "y");

Collection<String> values = multimap.get("1"); //containing a,b,c

Hazelcast - , / , , , , , . ; hazelcast.jar . .

Hazelcast Apache, . Google.

+2
0

, concurrency. , . , , .

( node_root) node, {data, prev_key, next_key}. prev_key next_key , "node_foo", foo - UUID ( , - UUID). .

, O (1) , "" "node_foo" foo. , . node, .

Now keep in mind that modifying this list at the same time is as bad as modifying any general data structure at the same time. If you use something like BDB, you can use their (excellent) transaction support to avoid this. For something without transactions or concurrency control, you want to provide external blocking or serialize access to a single thread.

0
source

Source: https://habr.com/ru/post/1704062/


All Articles