Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

It's always easy to write software that handles a single entity. However, designing software to handle multiple accounts/companies requires due diligence.

I'm currently doing initial research into database schemas that handle multiple accounts/companies, and I am asking if you can share a web page or open source software that demonstrates proper schema?

Edit: I was able to find the appropriate terminology for this, which is Multi-Tenant Data Architecture. A helpful Microsoft article describing the approach: http://msdn.microsoft.com/en-us/library/aa479086.aspx

Thanks.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

This is only slightly more complicated than a "single entity". Let's assume the worst case - multiple companies that each have multiple accounts. One table for companies. One table for accounts with a foreign key of the Company ID. Then each transaction has the foreign key of the Account ID. For all other data you need to decide if it belongs to one Company, one Account, or some other. I.e. employees can only work for one Company (generally speaking), so the Employee has the Company ID as foreign key. A Division would be in one company, same relationship.

It's all about understanding what belongs to who and establishing the relationship. That may sound awfully simplistic, but that's really about it.

Looking to use some established schema may save you a lot of effort, but that effort is what insures a good result. A good database design comes from asking ALL the questions - "Can an employee work for more than one division?" "Are purchases always charged to one department or can the cost be distributed?" "Do we need to keep track of more than one approval for an employee reassigment?" It goes on forever, but if you don't do it your system will be constantly disappointing the users and require endless modification.

share|improve this answer
    
+1: "Management of many men is just like the management of a few men. It is just a matter of organization." –  surfasb Jan 29 '12 at 0:47
    
Seems to suggest the effort that Google invested into Google Apps. I remember a large change to user structure, account structure linking accounts, etc. I agree, inspiring to dig deeper. –  crockpotveggies Jan 29 '12 at 2:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.