3 Replies - 702 Views - Last Post: 23 August 2012 - 12:05 PM

#1 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1043
  • View blog
  • Posts: 4,060
  • Joined: 02-July 08

Design - best practice?

Posted 23 August 2012 - 11:42 AM

I am wanting to know the best practice for scalability for the following design.

1 database,
multiple customers,
customers have apps or areas(web pages),
customers store data related to their environments.

In the main table where customers live they each get a unique Id, then for each table where I store specific data I must include this customer id, but I feel happening is the other tables and their related tables must also include this id so it remains theirs. If this is normal it seems fine as far as queries, but I also want to know if this follows best practice - if not what would you use?

Is This A Good Question/Topic? 0
  • +

Replies To: Design - best practice?

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8963
  • View blog
  • Posts: 33,621
  • Joined: 12-June 08

Re: Design - best practice?

Posted 23 August 2012 - 11:55 AM

Yes, if you are dividing people up by IDs and their data then yeah.. you'll need to have that id as a constraint on all tables.

I mean if user A, B, and C all want to put "123" in a table and later edit it you should allow for that. This helps also with keeping odd data from bleeding across accounts.
Was This Post Helpful? 1
  • +
  • -

#3 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1043
  • View blog
  • Posts: 4,060
  • Joined: 02-July 08

Re: Design - best practice?

Posted 23 August 2012 - 12:03 PM

Yes, that is correct. I am getting more elaborate with tables and data and just wanted to make sure the plan was correct. I am self-taught and would hate to start off with some bad design. Thanks modi!
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8963
  • View blog
  • Posts: 33,621
  • Joined: 12-June 08

Re: Design - best practice?

Posted 23 August 2012 - 12:05 PM

No problem. I have an app that I initially had planned to be flexible with multiple teams (and not bleeding over data), but was told "nope.. only one will use it". Shockingly three months later four other teams wanted it so I had to go back in and shoe horn in that 'team id' on the tables. A pain in the rear if you ask me.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1