sql - What is better: to have many similar databases or one database with similar tables or one database with one table? -


I need to work with many data samples, say, N samples equal Represent data but from different origins For example, the history of order in different shops. So the structure of all the samples is the same. I have many possibilities to work with data:

  1. Use the N database with the same schema, one for each sample

  2. Use a database, but for example N sets of tables, for example, User_1, ..., User_N; Product_1, ..., Product_N, Order_1, ..., Order_N and so on.

  3. Use a database with a set of tables, users, products, commands, but each table represents an auxiliary column that represents a sample index. Obviously, this column should be an index.

The final form seems most convenient to use because all questions are simplified. In the second case, I have a query as a parameter (this is possible?) (Stored procedures) need to send a table name.

How would you advise? Performance is very important. Step 1. Obtain a book on data warehousing - since it's you're done again.

Step 2. Divide your data into non-criteria properties such as facts ($, weight, etc.) and dimension (product name, order number, user name, etc.)

Step 3. Create a fact table (for example, order items) surrounded by that dimension of that fact. Order item product, order item customer, order order order number, order item date, etc. This will be a fact table and several dimension tables in the same database. Each "original" or "source" is just one dimension of the original fact.

Step 4. Use a very simple "SELECT SUM () group bye" to summarize and analyze your data.

This is the highest performance, the most scalable way to do business. Buy Ralph Kimball's Data Warehouse Toolkit Books for more information.

Do not build the N database with the same structure. Create one for the test for another build, but do not create N .

Do not build the N tables with the same structure. What are the keys for this.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -