Large-scale, multi-use database design

This is a discussion on "Large-scale, multi-use database design" within the Databases section. This forum, and the thread "Large-scale, multi-use database design are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jan 26th, 2007, 00:28
Reputable Member
Join Date: Mar 2005
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
Posts: 245
Thanks: 6
Thanked 0 Times in 0 Posts
Cool Large-scale, multi-use database design

I'm working on a project that has snowballed and I'm running into db issues that I never expected to face...

The client is opening a health spa. Multiple services will be offered - massage therapy, acupuncture, chiropractic, nutritionist, etc. - all provided by individual practitioners. The goal is that the sum will be greater than the individual parts by making it feel to the customer as though it's a single, cohesive, comprehensive facility. There will be centralized reception and scheduling and various other points of integration, probably including billing. One of the main goals of all this is for the various practitioners to help each other succeed through cross-promotion.

Because of this, I assumed a centralized database for all parties. Initially I designed a schema with a "business unit" field in various tables (products, services, appointments, etc.), using additional tables as necessary for proper normalization. But it doesn't feel right. But given the desire for cross-promotion and integration, multiple databases seems out of the question.

My latest thought is to use common clients/accounts tables and duplicate other tables using some naming convention like services_massage, transactions_chiro, products_nutri, etc.

Comments? Better ideas?

Thanks in advance!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jan 26th, 2007, 10:05
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 23
Posts: 1,669
Blog Entries: 1
Thanks: 1
Thanked 4 Times in 4 Posts
Re: Large-scale, multi-use database design

You were doing great with normalization in mind but your latest thought is bad bad BAD!

This is what in my experience is the most appropriate approach:

- Add more fields and tables to ensure normalization:
Use an additional field to filter products/services belonging to a certain department. eg.:
DEPT(dept_id,name,description,whatever)
SERVICE(service_id,dept_id,name,description,price)
PRODUCT(product_id,dept_id,name,description,price)

Then, instead of a 'services_massage' table, you'll have to use a query to find records in the services table that 'belong to' the 'massage' department.
eg:
Code: Select all
 SELECT name,price FROM SERVICES WHERE dept_id=6
--where 6 is the ID of massage dept
- Use views:
Once you've done the above, you can create views to make your life easier.
eg.:
Code: Select all
 CREATE VIEW view_Services_Massage
BEGIN
 SELECT name,price FROM SERVICES WHERE dept_id=6
 --where 6 is the ID of massage dept
the you can actually do this:
Code: Select all
 SELECT name,price FROM view_Services_Massage
Hope that helps...
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jan 26th, 2007, 18:54
Reputable Member
Join Date: Mar 2005
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
Posts: 245
Thanks: 6
Thanked 0 Times in 0 Posts
Re: Large-scale, multi-use database design

So I was barking up the right tree to begin with! It just seemed (never having done anything like this before) that the schema looked pretty funky with all those BU_ID fields. It makes a lot more sens, though, when you factor in the views.

Thanks for the help!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jan 27th, 2007, 17:46
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 23
Posts: 1,669
Blog Entries: 1
Thanks: 1
Thanked 4 Times in 4 Posts
Re: Large-scale, multi-use database design

No worries
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
database, scalability

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi-league and Multi-tiered team schedule overkil6 Website Planning 3 Jun 17th, 2008 22:04
Seeking Advice for Multi-Language website design jssaggu Scripts and Online Services 0 Jun 1st, 2007 20:44
Scale/Zoom with AS PixelLuv Flash & Multimedia Forum 8 Mar 9th, 2007 22:26
Interactive Scale - Please vote! masonbarge Free Web Site Critique 7 Jan 11th, 2007 15:04
Database Design Help gustava32 Databases 2 Nov 3rd, 2006 16:04


All times are GMT. The time now is 01:20.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved