Answer the question
In order to leave comments, you need to log in
One or more databases?
The question is this:
A project is planned with a large amount of data, a PostgreSQL subd.
It is planned to store data about users in the database, a large number of directories that are linked to these users, and much more. The tables will store millions and tens of millions of records. What is the best thing to do, store all entities in one database or create several databases and store different entities in different databases? If you store data in different databases, then there is a problem of linking this data, because records of tables of different databases cannot be linked by keys. If you store everything in one database, then there may be performance problems. Please share your thoughts.
Answer the question
In order to leave comments, you need to log in
My opinion is to store everything in the 1st database, because related data. 100 million records is not a lot, especially if the database is well designed, there are the necessary keys and all that. It will make sense only when you run into hardware performance and there will be no other way to remove performance problems, except to split the database into different servers, but you still need to try to get to such problems.
in one database, it makes sense to shove it into several, all the same, the tables are different and there is no difference that the tables are in one or several databases for the postgres itself
If you have several databases on one server, you will still have problems with disk performance. There are several databases, but the disk subsystem (both the processor and the RAM access bus) is the same.
If you have several databases on different servers, then network delays are added.
I would re-architecture the application (if it's still possible). I would put a part in a highly specialized database like Tarantool. https://habrahabr.ru/company/oleg-bunin/blog/310690/
PS:
Tens of millions of records for a modern DBMS is nonsense.
I have billions spinning on a single PostgresSQL server - the flight is normal.
Optimized PostgreSQL configuration (set to efficient RAM usage)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question