This discussion is archived
9 Replies Latest reply: May 22, 2013 9:53 PM by rshanker RSS

Distributed Cache queries

rshanker Newbie
Currently Being Moderated
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,

~Ravi Shanker
  • 1. Re: Distributed Cache queries
    1009220 Newbie
    Currently Being Moderated
    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
  • 2. Re: Distributed Cache queries
    robvarga Oracle ACE
    Currently Being Moderated
    rshanker wrote:
    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 Ravi,

    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,

    Robert
  • 3. Re: Distributed Cache queries
    rshanker Newbie
    Currently Being Moderated
    Hi Robert,
    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
  • 4. Re: Distributed Cache queries
    robvarga Oracle ACE
    Currently Being Moderated
    rshanker wrote:
    Hi Robert,
    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 Ravi,

    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,

    Robert
  • 5. Re: Distributed Cache queries
    rshanker Newbie
    Currently Being Moderated
    Hi Robert,
    Thanks for the above.

    In a redundancy system only one server will be serving and the secondary will be idle. I just want to ensure that these idle systems are also used instead of lying idle.
    Hence the question was raised on can we control the Distribution logic, where-in the least used data can be moved into these idle systems and re-direct the usage of data to these idle systems.


    but i have few things required for clarification.
    While running the sample programs as per the documentation. We need to start a Default Cache Server and the java programs which act/add as cluster to the cache server.
    But i have seen adding/acting of cluster is working even if the Default Cache Server is shut down?

    Can u provide any info (links) or clarification how the Cache Server and Clusters mechanism work? Gone through the documentation but none has provided a clear picture of this?

    Thanks,
    Ravi Shanker
  • 6. Re: Distributed Cache queries
    user738616 Pro
    Currently Being Moderated
    Hi,
    In a redundancy system only one server will be serving and the secondary will be idle. I just want to ensure that these idle systems are also used instead of lying idle.
    Hence the question was raised on can we control the Distribution logic, where-in the least used data can be moved into these idle systems and re-direct the usage of data to these idle systems.
    In Coherence cluster, all the servers hold both primary and backup data, every is serving the requests and holding the backups as well so there are no idle systems.
    but i have few things required for clarification.
    While running the sample programs as per the documentation. We need to start a Default Cache Server and the java programs which act/add as cluster to the cache server.
    But i have seen adding/acting of cluster is working even if the Default Cache Server is shut down?
    Can u provide any info (links) or clarification how the Cache Server and Clusters mechanism work? Gone through the documentation but none has provided a clear picture of this?
    This is wrong assumption and every storage enabled node can become the cluster member. DefaultCacheServer is one of the implementations to run coherence server.

    HTH

    Cheers,
    _NJ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
  • 7. Re: Distributed Cache queries
    robvarga Oracle ACE
    Currently Being Moderated
    Hi Ravi,
    rshanker wrote:
    Hi Robert,
    Thanks for the above.

    In a redundancy system only one server will be serving and the secondary will be idle. I just want to ensure that these idle systems are also used instead of lying idle.
    With Coherence there are no idle backup only JVMs (unless you write a PartitionAssignmentStrategy to that effect).
    Hence the question was raised on can we control the Distribution logic, where-in the least used data can be moved into these idle systems and re-direct the usage of data to these idle systems.
    In my opinion, load-based partitioning is not necessarily a good idea. How do you achieve a balanced distribution with ever changing load? You would need to move partitions which are in use (and typically some of the heavily used ones), which prevents their use and so they are going to be even slower due to not processing requests while being in transit.


    >
    but i have few things required for clarification.
    While running the sample programs as per the documentation. We need to start a Default Cache Server and the java programs which act/add as cluster to the cache server.
    DefaultCacheServer is called that because it is the default configuration not because of some default identity. Each JVM in range which are using the same multicast group address (or well-known-address group) becomes part of the same cluster. Whether a JVM services requests or not is aligned with that JVM being storage-enabled for a Coherence distributed cache service or not. There are other cache topologies besides distributed cache, but the concept of a JVM not servicing requests does not exist for them.

    But i have seen adding/acting of cluster is working even if the Default Cache Server is shut down?
    A default cache server is a JVM which is part of the cluster and has the default configuration for a storage-enabled node. But cluster membership does not have anything to do with being a cache server or not (which has to do with being storage-enabled).
    Can u provide any info (links) or clarification how the Cache Server and Clusters mechanism work? Gone through the documentation but none has provided a clear picture of this?

    Thanks,
    Ravi Shanker
    Read up on services and storage disabled/enabled mode of operation.


    Best regards,

    Robert
  • 8. Re: Distributed Cache queries
    rshanker Newbie
    Currently Being Moderated
    Thanks Robert.
    Ill go through it.. Thanks for detailed information.

    ~Ravi Shanker
  • 9. Re: Distributed Cache queries
    rshanker Newbie
    Currently Being Moderated
    Thanks,
    Ravi Shanker

    Edited by: rshanker on May 22, 2013 9:53 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points