Hi,
I am new to designing large databases. I could use some advice regarding the best database structure.
We are in a database design plan, so how would be the best way to do this.
I have a table, called transactions and this table holds all financial transactions within a company.
Our plan (dream) is to have thousands of companies on the system, that each has 1,000-5,000+ transactions, so that means we can potentially have up to 25,000,000+ records in the table.
My questions is – should I have one table for all companies ie:
table.transactions – holds all 5,000 companies * 5000 transactions = 25,000,000 records
or should I give each company their own table ie:
table.transactions_company_0000001 – holds company 1 and 5,000 transactions (records)
table.transactions_company_0000002 – holds company 2 and 5,000 transactions (records)
table.transactions_company_0000003 – holds company 3 and 5,000 transactions (records)
etc. * 5,000+ tables
If I give each company their own table it would also be more secure I think, but the administration of the tables will be more difficult, as if I need to add a field or make changes, I need to go through all tables or at least program a script that does it.
Is it possible for each table to inherit a scheme or something from a main table, so I only need to make changes to one table.
What is the best way to do this, performance wise and secure wise.
Any feedback is very much appreciated.
Kind regards,
Kim
I am new to designing large databases. I could use some advice regarding the best database structure.
We are in a database design plan, so how would be the best way to do this.
I have a table, called transactions and this table holds all financial transactions within a company.
Our plan (dream) is to have thousands of companies on the system, that each has 1,000-5,000+ transactions, so that means we can potentially have up to 25,000,000+ records in the table.
My questions is – should I have one table for all companies ie:
table.transactions – holds all 5,000 companies * 5000 transactions = 25,000,000 records
or should I give each company their own table ie:
table.transactions_company_0000001 – holds company 1 and 5,000 transactions (records)
table.transactions_company_0000002 – holds company 2 and 5,000 transactions (records)
table.transactions_company_0000003 – holds company 3 and 5,000 transactions (records)
etc. * 5,000+ tables
If I give each company their own table it would also be more secure I think, but the administration of the tables will be more difficult, as if I need to add a field or make changes, I need to go through all tables or at least program a script that does it.
Is it possible for each table to inherit a scheme or something from a main table, so I only need to make changes to one table.
What is the best way to do this, performance wise and secure wise.
Any feedback is very much appreciated.
Kind regards,
Kim