Hiding Access to Multiple Databases

From: Shane Mingins (shanemingins_at_yahoo.com.clothes)
Date: 02/25/04


Date: Thu, 26 Feb 2004 11:57:23 +1300

Hi

I am wondering if there is a pattern/solution to accessing multiple
instances of a database?

As an example:

I have two different databases (A & B) with Customers in. Customer "Xavier
Smith" is in both databases.

In database A Xavier has sales of $1000.00
In database B Xavier has sales of $2000.00

What I want to achieve in the Domain Layer is something like:

DB.getCustomers() and return a list of distinct customers, IOW Xavier will
appear once.

Then with the instance of Customer representing Xavier I wish to be able to
call getTotalSales(DateRange) and return $3000.00

The only possibilities that I can see is either:

One solution needs Customer to "know" which of the databases it came from
(i.e. A or B, or both A and B) to quickly request the sales values;

Or the databases are re-queried when getTotalSales is called to determine
which contain the Customer to then request the sales values;

Or each database is queried for sales values with one of those queries
possibly returning zero.

So are there other possibilities to consider?

Or is it a question of choosing between performance over separation, IOW to
totally isolate the Domain Layer from knowledge of the "where" it came from
there will be a loss in performance?

[In case it is relevant to a reply, I am using Java, the databases are
proprietary with read-only access via JDBC-ODBC]

Thanks
Shane

shanemingins@yahoo.com.clothes
remove clothes before replying

"When everybody actually is out to get you, paranoia is just good
thinking." -- Woody Allan



Relevant Pages

  • Re: Proper use of database splitting
    ... If it were me Id set it up as similar to a sales logic ERP program that a ... Main database backend on the server has everything. ... the process of doing this all of his customer records gets a CustCheckedOut ... Sales rep comes back with a boat load of sales and new accounts. ...
    (microsoft.public.access.formscoding)
  • Re: Proper use of database splitting
    ... Put the master backend template on the server so that all sales reps use the ... Also require all sales reps to put their backend database ... upload and down load customer databases and not need to do anything else. ...
    (microsoft.public.access.formscoding)
  • Re: Proper use of database splitting
    ... sales rep and use it as the backend for each sales rep. Create a template ... customer mdb for the front end and link to the backend database. ...
    (microsoft.public.access.formscoding)
  • Re: Hiding Access to Multiple Databases
    ... > In database A Xavier has sales of $1000.00 ... solution and passed through to the DB access subject matter with the ...
    (comp.object)
  • Re: Proper use of database splitting
    ... A sales rep may not only be working with one ... and its safe to delete that customers database. ... updated customer back to the server for others to access and copy another ... > customer mdb for the front end and link to the backend database. ...
    (microsoft.public.access.formscoding)