we have a following problem. Our enterprise application has a database in MySQL, and it seems like it's structure becomes too complex - where are more than 100 tables (it has been developing for 7 years now).
However, most tables don't have any relations to any other tables at all. There are some common tables (dictionaries) that are used by everyone (about twenty such tables), but that's all. The question arose how to make this database faster and more reliable.
I read a lot about database decomposition. That is, you place table relating to different domains in different databases. For example, anything related to waybills and other paper stuff is placed in database called Papers, and anything related to the customers and their orders is placed in database called Clients and so on.
Here we have two problems:
- The user should see the enterprise application as acting on a single domain. The developers must change the core working with database in a way, so that it could address several databases.
- The common tables rise a problem. They have to be kept in a single database and cannot be replicated in all databases after decomposition. Therefore, how do we make a query SELECT * FROM A JOIN B, there A and B are in different databases (on different servers)?
Both questions actually address the same problem - are there any common Enterprise patterns (like GoF) for solving this problem? I am particularly interested for patterns suitable for Java EE.