0

I am working on a new MySQL database that will store orders/customer information for around 15 different services. 7 of the services are similar in regards to the information that is stored with a few of the 7 services requiring an additional piece of information. There other 7-8 services are similar to each other as well but not as similar the the first 7. So my question is how should I break this down into a MySQL database?

Should each service have its own table? If this is true, what is the best way to link tables? Any advice is greatly appreciated!

Also, here is a sample of the type of info that will be stored:

enter image description here

1
  • Make sure all of the addresses are in one table, not 3. Each service should not have its own table. You need to read up on Table Inheritance. Martin Fowler does it right. Jan 28, 2013 at 19:12

2 Answers 2

1

good lord, no.

  1. read up on multi-tenancy http://msdn.microsoft.com/en-us/library/aa479086.aspx

  2. read up on the Party Model http://www.tdan.com/view-articles/5014/

  3. read up on Table Inheritance http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html

Then go read the data modeling books by Fowler, Silverston, or Hay.

0

One way to do it would be to have a primary table for orders that stores all of the common information. For the 7 or 8 other services with very different information, you could have tables such as Service_7_aux_orders_data (sorry, there's not enough information in the question to provide a better sample name) with a foreign key to your main orders table. When you query, you can join this table to the main order table to get the full order.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.