RE: Database replication and caching

From: Gentry, Michael \(Contractor\) ("Gentry,)
Date: Mon Jul 31 2006 - 12:11:45 EDT

  • Next message: Borut Bolčin: "Re: Database replication and caching"

    I'm not familiar with PostgreSQL's replication capabilities, but I'd be
    concerned about primary key duplication and possible data loss (this
    would be outside of Cayenne's control). For example, what would happen
    if both applications ran the sequence to generate PKs at the same time?

    -----Original Message-----
    From: Borut Bolcina [mailto:bo..ajdi.si]
    Sent: Monday, July 31, 2006 11:52 AM
    To: cayenne-user
    Subject: Database replication and caching

    Hello,

    I need an advice on using Cayenne in an environment where two PostgeSQL

    databases are configured to replicate from each other for failover
    capability. 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?

    Is there any other (caching) problem you see in this architecture?

    Regards,
    Borut



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