Re: Database replication and caching

From: Tore Halset (halse..vv.ntnu.no)
Date: Mon Jul 31 2006 - 14:29:32 EDT

  • Next message: Nikolai Raitsev: "Problem with DB2 UDB"

    Hello.

    On Jul 31, 2006, at 17:52, Borut Bolčina wrote:

    > I need an advice on using Cayenne in an environment where two
    > PostgeSQL databases are configured to replicate from each other
    > for failover capability.

    Are you using Sequoia[1] or slony[2] or creating your own solution?

    > I am thinking of two Cayenne enabled applications (load
    > distribution) which insert records in one of those two databases.
    > Application one (A1) inserts in database one (DB1) and application
    > two (A2) inserts in database two (DB2).
    >
    > The insertion, deletion or update will cause Java triggers in
    > PostgreSQL to call appropriate Java method in the application. If
    > for any reason one of the databases is down for some time, the
    > replication mechanism will bring the second database up-to date
    > which will trigger invocations of the Java methods, so the second
    > application will be in the correct state also.
    >
    > As long as triggers do not modify records, everything should be ok
    > with Cayenne. In case, which I don't foresee now, the records will
    > be modified on database level, all DataContexts should be
    > invalidated, am I right?

    Cayenne has its own way of syncronizing cache[3] between app
    instances. You could also invalidate cache manually.

      - Tore.

    [1] http://sequoia.continuent.org/HomePage
    [2] http://gborg.postgresql.org/project/slony1/
    [3] http://cwiki.apache.org/CAYDOC/configuring-caching-behavior.html



    This archive was generated by hypermail 2.0.0 : Mon Jul 31 2006 - 14:30:12 EDT