-
Accessing two different database (4 messages)
- Posted by: Shafeeque EV
- Posted on: February 07 2008 01:08 EST
Hi, if an application requires access to two different database for all its operations, like an operation will first check for the data in one database, and if it does not exist it will check in the second db, what will be the best design strategy? or do we have a pattern for this kind of problems? I know that, we have to do a datasource switching, But as all the operations requires this check, what will be the optimum, scalable way to do this?Threaded Messages (4)
- Re: Accessing two different database by Race Condition on February 12 2008 12:55 EST
- @Race Condition by Abhijit K on February 26 2008 01:54 EST
- connection pool for two database by Web east on March 06 2008 03:24 EST
- Re: Accessing two different database by Anthony McClay on March 26 2008 16:38 EDT
-
Re: Accessing two different database[ Go to top ]
- Posted by: Race Condition
- Posted on: February 12 2008 12:55 EST
- in response to Shafeeque EV
Hi, if an application requires access to two different database for all its operations, like an operation will first check for the data in one database, and if it does not exist it will check in the second db, what will be the best design strategy? or do we have a pattern for this kind of problems?
Yes, it's called the "Accessing two different database" pattern. You can find it at AccessingTwoDifferentDatabase.com
I know that, we have to do a datasource switching, But as all the operations requires this check, what will be the optimum, scalable way to do this? -
@Race Condition[ Go to top ]
- Posted by: Abhijit K
- Posted on: February 26 2008 01:54 EST
- in response to Race Condition
not able to open/get the site u have stated.. can u post a link? -
connection pool for two database[ Go to top ]
- Posted by: Web east
- Posted on: March 06 2008 03:24 EST
- in response to Race Condition
every request checks the db will waste time you can create a db pool for the two db it must be keep every connection is valid -
Re: Accessing two different database[ Go to top ]
- Posted by: Anthony McClay
- Posted on: March 26 2008 16:38 EDT
- in response to Shafeeque EV
well, I know of no nifty little pattern for this. I assume using a JEE 5 Server, and JPA(Java Persistence Architecture), or JPA by itself. Well I sense a Finder Method calling a JPA Named Query to two different Persistence Units attached to two different data sources. I assume this was your default implementation. If there is a way in which the databases may be linked. I believe Sybase had this functionality to link two databases as a virtual database, and access both database's through Query Views, would be better. pending you have a database that supports this. This also puts more dependency in you database vendor to handle that connection and configuration, so there are no great answers. - best of Luck. Tony McClay