Using LLBLGen against Oracle and Postgres concurrently

Posts   
 
    
greenstone
User
Posts: 132
Joined: 20-Jun-2007
# Posted on: 16-Jan-2018 19:02:26   

Hi,

We're transitioning our system from Oracle to Postgres.

We have both Oracle and Postgres database-specific code for use by llblgen. Using either the Oracle or the Postgres works great!

We have both our Oracle and our Postgres database stood up in production. The Oracle is being used, and the Postgres (structurally identical to Oracle) is waiting to be used.

To reduce the risk that there may be performance (or other) issues when running Postgres as the database, we are trying to come up with a transition strategy. As our system has many thousands of concurrent users, it is difficult to accurately test (the Postgres) under true load.

One idea I had was to run both Oracle and Postgres concurrently (so we can flip off Postgres if we find a problem). To do this, we would want an .EntitySave() to save first to Oracle, then to Postgres (maybe spawn the Postgres .EntitySave() to a separate thread?). Then the same idea for Entity Fetch, Entity Collection Fetch, etc.

Is there a way we can have any EntitySave and EntityFetch and EntityFetchCollection, etc. to do these for both Oracle and Postgres (at the same time...or one after the other)?

Thanks for your thoughts

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 17-Jan-2018 07:16:17   

greenstone wrote:

Is there a way we can have any EntitySave and EntityFetch and EntityFetchCollection, etc. to do these for both Oracle and Postgres (at the same time...or one after the other)?

If you use DataAccessAdapter, you might have two generated DAL projects:

YourCompany.DAL.Oracle...
YourCompany.DAL.Postgres...

so you can use both (with different connection strings) in your same project:

using (var adapter = new YourCompany.DAL.Oracle.DataAccessAdapter())
{
   ...
}

using (var adapter = new YourCompany.DAL.Postgres.DataAccessAdapter())
{
   ...
}

You could use a Factory class to make it easy this selection.

IMHO you should try to make a staging environment and do tests that mimic the real life using Postgres.

David Elizondo | LLBLGen Support Team
greenstone
User
Posts: 132
Joined: 20-Jun-2007
# Posted on: 24-Jan-2018 19:10:39   

Thanks!