Answer the question
In order to leave comments, you need to log in
How to correctly create a database architecture for multiple services?
At work, they are asked to create several services: displaying information on the scoreboard, statistics on the load of cabinets, requests for maintenance, etc.
At a stage of "thinking" there was a question how to organize a DB. For each service, create a separate database, or do everything in one? Without hesitation, you can use one database and simply add some kind of prefix to the tables. To what extent is it expedient? I think the answer is obvious, but I can not ask. :)
Ps I chose the Laravel 5 framework for development.
Answer the question
In order to leave comments, you need to log in
If you didn't have MySQL in the tags, I would say "use schemas". In normal DBMS, "database" is the unit of administration and "schema" is the namespace, i.e. just what you need for various services and subsystems.
Judging by what you described, you have several services, but the subject area is the same, right? those. these services are still connected, and you may (even probably) need relationships between tables of different services. And here I would also tell you "use the schemes."
It is desirable to store absolutely unrelated data in different databases, such that you can take one of the databases and easily transfer it to another server, or even to another DBMS. For example, you have a CRM system in one database, and your mail server stores data in another.
But since you mentioned MySQL, I'm telling you "use prefix to tables". To Alexander
's
answer : just the same, if these are all services of one enterprise, then authorization would be better as a separate service, on a par with the rest. Also with its own scheme/prefix.
If there are connections between these tables - for example, information on the scoreboard and maintenance are somehow connected, then I would do it in one. If not, in different ones, because these are initially different business processes.
In general, it depends on the amount of work. If a small number of tables, then all in one, if there are many - in different ones. Just for ease of development.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question