Shared use of databases

Asked

Viewed 154 times

0

A Mysql database can have shared use, that is, more than one CMS can use the same database, changing only the table name?

Are there limits? Are there contraindications? I’m asking because I’m studying AWS and I’m thinking of creating a RDS BD and connecting to this BD more than a CMS.

  • Power can do it, but it’s not the right thing, first of all it’s going to be something very big and difficult to manage, not to mention that there can be confusion when you’re working on something, which can be a big problem for data integrity.

  • 1

    Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).

1 answer

3

It can, and it is correct to do so if you know what you are doing. It has even a name: it is called multi tenancy. If you do it right and understand what you are doing it is easier to manage the structure because it solves in just one database everything for all instances of CMS.

Some people care about performance, but that’s tiny, almost immeasurable, and if that’s a problem at all, it’s something very large and probably more because of the general architecture and choice of wrong technologies than because it’s chosen to be multi tenancy.

There is no integrity problem because of this, the database can manage this kind of situation well. Can you make any mistake? Of course, but you can commit in any situation. You can commit precisely because you did it separately, and in fact I’ve seen many cases where the person got lost by breaking up. In any option you have to do it right, there is no situation that can make mistakes and everything is fine.

You don’t even need to change the table names, you can use them, it depends on what you want.

For everything there are limits, but in general you don’t have to worry too much about it, it is much more difficult to architect well, model correctly than decide about it.

And for everything has contraindications. Of course there is some difficulty in doing it this way, it just does not mean that otherwise it does not have difficulties.

Note that I am not saying that you should use, I do not know your case, I am saying that it is not a problem to use it if it is the most suitable for you. The decision is not simple and cannot be based on what random people told you on the Internet without knowing what real difficulty you have and what you need to solve. Without you knowing it can’t make the right decision.

Remember, if you don’t know what you’re doing everything can go wrong and it’s best not to. Developing software is not a joke of riding Lego, it depends on deep knowledge and various disciplines.

  • First, it was very good to know that there is even technical term for this type of BD use. Sign that is not considered gambiarra. I have done many courses in udemy and seen videos on Youtube. I also read and attend Devmedia, which has courses in Mysql, which would be one of those necessary knowledge, right? What other disciplines would be useful? At AWS, which small comic book would you recommend? They say that Aurora is based on Mysql and performs better. It will be very useful for me to have only one comic book, with limits, for more than one CMS. Knowing the risks, I will take care.

  • Another important detail: if a given CMS blows up, can I migrate the data relating to it from this Multi Tenancy BD to another BD? That is, is it possible to create an upgrade strategy for storing data from a CMS from a Multi Tenancy to a unique BD? At AWS I can do this, if possible, without stopping the service.

  • Guys, I’ve read several questions inside the "multitenancy" tag and I think I can close that question. Aurora-AWS doesn’t seem to be within the scope of this site. The top question was practically answered here: https://answall.com/questions/15390/como-workwith architecture-multi-tenancy

Browser other questions tagged

You are not signed in. Login or sign up in order to post.