Question:
which is better, single database or multiple databases?
Linesh Jose
2014-01-26 23:32:16 UTC
Hi,
I'm planing to start code a my new project. It's a big project, so which database structure is best single database or multiple databases. I'm using Mysql for databases. I looking for a pros/cons opinion

Please share your valuable opinion
Four answers:
Jeff P
2014-01-27 06:49:05 UTC
Well, it's really hard to answer your question without knowing more about your project. Sometimes it's better to use multiple database and sometimes it's better to use a single database. It just depends what your application is going to do. You may want to store your users' data in one database, but store analytic information in another database. Your question is a little vague, and without more details, we can't really help you.
darrenforster99
2014-01-27 00:36:30 UTC
Use a single database but with multiple tables and then create relationships between each table - you do know about data structure diagrams and data flow diagrams (possibly my least favourite subject when I studied computing at Uni).



You create a data structure diagram which shows the fields you need in each table, and then you also create relationships between the various tables. Normally you have a many to one relationship e.g. you have a customer database...



Customer Table consists of



Customer ID

Customer Name

Customer Address



and the Receipt table might consist of



Receipt ID

Customer ID

GoodsList ID



the customer ID would be a one to many relationship to the customer because a receipt would only have one customer, where as a customer could have many receipts. The goodslist id would be a relationship to a goods list which would then relationship on to the goods (it works around a many to many relationship because a receipt with a direct relationship with goods could cause problems because you would have many goods and goods could belong to many receipts - you should always evade many to many links in tables).



See this link for more information on data structure diagrams

http://en.wikipedia.org/wiki/Data_structure_diagram
2014-01-27 01:35:04 UTC
Single DB with multiple tables is a preferred choice. However you can make multiple DB 's and put similar entities there but it is complex. I always use single DB with multiple tables. Its easy to create relationships in them and its manageable
2014-01-27 02:33:53 UTC
Have a glance at http://www.sett.com/alien


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...