Jump to content

Database compliance question


RopeADope

Recommended Posts

Hi all.

 

I'm working on a business application that stores data for several clients.  I'm trying to figure out what the best practice is for this sort of application.  Should each client have their own database or is it safe to store all the clients data in one database?

Link to comment
Share on other sites

The application database is ~55 tables so if I did separate databases for each client, that's what would be created every time.  In my head, it seems like a lot to be remaking for every client but my assumption is that security would be tremendously easier because I could set user permissions per database, correct?

Link to comment
Share on other sites

you can set user permissions per table, you can prefix each table for each client, no need for a new databases.  The issue comes when you want to administer the databases, if you have 100 clients with 55 tables each all in the same database, that's 5500 tables you need to sift through to get the ones you want.  Having a master table that can pull the client  tables by prefix makes this nice and easy, as does segregating the tables over multiple databases ( normaly by region - such as europe, america, asia all get a database each) that way you can filter down where you look by the information you have on your client.

Link to comment
Share on other sites

If I prefixed the tables, I'd still have 5500 tables (assuming 100 clients).  I guess that's why it seems like separate databases would make more sense because then they could authenticate to the database and I could reuse the same code for every client.  If I prefixed tables, wouldn't I have to adjust queries to use the proper prefix?

Link to comment
Share on other sites

Your third option isn't a commercialy viable solution.  No company is going to accept that their information is held in the same table as several other companies all with the same access level.  I am not sure how many users you can acctualy assign to a database (I think it's noth of 320,000 - but I just pulled that from thin air) but you can still use database authentication to dictate which table prefix they can and can't access.  I think Fenway's first post was in refference to If you ever need to cross refference the information between multiple companies over multiple databases it's a pain in the ass (such as generating reports on time allocation for a support service). 

Link to comment
Share on other sites

Ah, okay.  Thank you both very much.  I have a much better understanding now.  I think the route I'll need to take is the table prefix method.  Eventually, there will be some cross-client data mining for internal purposes so I'd like to be prepared for that.  Thanks again!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.