Organize Data in a DataSet

  • Thread starter Thread starter Lore Leunoeg
  • Start date Start date
L

Lore Leunoeg

Hello

I'm busy with a client application which is working on client-data. Client
data are spread over several 1:n tables in the database. How should I
organize data in the dataset(s) ?

1) Create one dataset for each client with the tables which select only the
data specific to this client.

2) Imitate the table structure and relations of the database, means: one
dataset including one table for all the clients, one table for all the
addresses, one table for all the bankaccounts etc.).

What are the advantages and what are the disadvantages or is there only one
way to do it?

Thank you
Sincerely
Lore
 
The only thing that changes is table name, right?

If so, you should alter the query to hit a different table based on client.
You then do not have to build a new DataSet each time you add a client and
redeploy your application.

The disadvantagees of one dataset for each type for each client is it
becomes completely unmaintainable after you add on enough clients. If you
alter the query, you can at least set up mappings for clients to table names
and dynamically create the query.

An even better way is not segregating client data in this way and, instead,
mapping clients data to their account, so all tables are related not only to
other tables in the microcosm, but also to a client entity. This is the most
maintainable over time.

Another option is separate identical databases. Also more maintainable, as
you only have to adjust connection string when another client comes on. It
is not the best option, necessarily, but also very maintainable.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
 
Back
Top