Oracle Community Network
Hi,
In a distributed cache scheme ( in multiple servers/jvm).
1. how to know which server is hosting what data (cache store) and the backup of this data is in which server?
2. Can this distribution be controlled? like a 'xyz' cache store is required to be in a specified '123' server only and that of the backup of 'xyz' cache store is required to be in '234' server?
Thanks
Tags:
1) The point is that you are not supposed to worry about that. The data gets distributed using the key which then gets mapped against a specific partition. This partition can migrated between different members w/o having to know about the actual location of the data.
2) Yes you can associate items, as said in 1) the thing determining which partition an entry belongs to is the key. If can associate another item by using KeyAssociation that will tells the distribution algorithm to use a different value to determine the ownership
Hi,
In a distributed cache scheme ( in multiple servers/jvm).
1. how to know which server is hosting what data (cache store) and the backup of this data is in which server?
Hi Rodas,
You are confusing cache stores with ownership. Cache stores are practically DAO classes invoked automatically to persist cache changes to a backing storage, usually a database.
Data ownership is automatically managed by Coherence, although you can have influence on it on several levels:
- key association lets you define groups of keys which belong to the same partition (thus you can have partition level transactions on them and also you can rely on aggregation them together)
- key partitioning strategy lets you control which associated keys fall to which partition (i.e. you can force a partitioning strategy on Coherence if you don't like the default CRC32-based hashing), but Coherence still decides which member owns which partition
- partition assginment strategy decides which server owns which partition. You should not change this unless you REALLY know what you are doing, as this strategy is what guarantees that Coherence keeps your data as safe as possible (e.g. locates primary copy as far from a backup as feasible ensuring that if possible, then even if you lose an entire box containing several JVMs, your data still has copies on other boxes)
2. Can this distribution be controlled? like a 'xyz' cache store is required to be in a specified '123' server only and that of the backup of 'xyz' cache store is required to be in '234' server?
You should not mess with this thing. E.g., what would happen in your use case, when that 123 server dies? You don't want your data anymore? What if 123 and 234 are on the same box? Do you not care about losing it with a single failure if the box dies?
Best regards,
Tobler
Hi tobler,
Thanks for the detailed info.
I was actually trying to bring on this distributed cache system in a redundancy system in which case, system can run if one of the server is down for a limited period of time.
I will look into the further details on the design point
hi,
if you have sufficient memory for all your data in the remaining servers, Coherence can cater for the high-availability requirements for your data out-of-the-box and possibly your business logic as depending on your requirements.
Best regards
© 2024 Created by Maisam Agha. Powered by