多个数据库中表之间的关系(relations between tables in multiple databases)
我正在构建一个复杂的平台,我希望为它的每个“模块”都有一个专用的数据库。 但我需要一个“主”数据库,它有一些像users表这样的公共表。 我需要能够在多个数据库中的表之间使用外键。 (比如user_id)
我知道如果数据库与他们现在所在的服务器相同,我可以拥有跨数据库关系,但我不想受此限制,因为如果应用程序增长很多,我可能需要将数据库分成多个服务器。
所以,在做出决定之前,我正在寻找所有选择。
你对此有何看法?
我正在使用mysql。
I am building a complex plataform, and I want to have a dedicated database for each "module" of it. But I need to have a "master" database which has some common tables like the users table. I need to be able to have foreign keys between tables in multiple databases. (like the user_id)
I know I can have cross database relations if the databases are in the same server which they are right now, but I dont want to be limited by that, since if the application grows alot i might need to separate the databases into multiple servers.
So, I am looking all my options, before taking my decision.
Whats your toughts about this?
I am using mysql.
原文:https://stackoverflow.com/questions/10879927