Re: ObjectStore and Caching

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Jan 09 2004 - 19:45:44 EST

  • Next message: James Treleaven: "Re: ObjectStore and Caching"

    On Jan 9, 2004, at 6:19 PM, James Treleaven wrote:

    > Hi
    >
    >
    > I am looking at deploying my webapp which uses Cayenne across a
    > cluster of webservers, and I just want to make sure I don't get bitten
    > by Cayenne's caching architecture.
    >
    > My understanding is that Cayenne currently does caching within a
    > single Java VM, and that the intention is to provide cross VM caching
    > in the 1.1 release:
    > http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-30
    >
    > Is single-VM caching turned on by default? If so, does this mean that
    > if I deploy my Cayenne app across a cluster I will run into problems?
    >
    > thanks,
    > James

    Hi James,

    Let me explain current and future levels of caching in Cayenne. When I
    am talking about DataContexts/DataDomains below, this assumes whatever
    helper objects they are using for caching (e.g. ObjectStore). More
    detailed documentation will be included in 1.1.

    Level 1 - No Cache Sharing: DataContext keeps its own cache - whatever
    is fetched from the database via a DataContext is never shared with
    other local or remote DataContexts. Changes made on commit are not
    propagated to other DataContexts.

    Level 2 - Local VM Cache Sharing: Each DataDomain keeps the cache
    shared by all DataContexts in the same VM. Changes made via one of the
    DataContexts are automatically shared by other DataContexts in the same
    VM.

    Level 3 - Distributed Cache Sharing: Behaves just like Level 2, but
    also synchronizes caches of DataDomains with the same name across JVMs.

    Cayenne 1.0.* implements Level 1 only, i.e. no sharing of cache either
    locally or remotely. Cayenne 1.1 will have all three levels supported,
    configurable via CayenneModeler. Ideally no application code changes
    will be required to switch between the levels. Also this means that 1.1
    is fully backwards compatible with 1.0.

    Hope this answers your questions.

    Andrus



    This archive was generated by hypermail 2.0.0 : Fri Jan 09 2004 - 19:45:48 EST