开发者

best practices of separating two dependent sets of data in mysql

My application needs two sets of data, and I want to separate it logically on two parts. It's ideal to have namespaces for tables in one instance of mysql database, but I can't find any clues that this feature exists. So, I decided to split data onto two schemas (static & dynamic) in one instance of mysql. Though, my dynamic data depends on static part, and some of my stored procedures in dynamic selects data from static database.

What is the best practices to avoid hardcoding schema names in st开发者_如何学编程ored procedures, or splitting data in similar way I want?


This is often done with Synonyms, but MySQL does not support that. You didn't say exactly why you wanted to 'logically separate' the data; this could be done by just prefixing the table names with some sort of identifier. To avoid the hassle of hard-coding schema names I suggest rethinking separating the tables.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜