I wondered if perhaps anybody has an opinion on the following problem.
I have an EJB3 setup that services the needs of a customer. This means I have one EJB3 app deployed that connects to a MySQL database schema. However, lets imagine I have 1000 customers. Each customer will have their own MySQL schema, although structually they are identical.
A solution is to deploy the EJB3 app 1000 times and simply change the persistence.xml file to set the correct MySQL schema. However, this seems overkill and certainly not scalable.
In the serverside discussion, the notion of simply having one schema is raised rather than having 1000 different schemas. Obvioulsy each table would have to have some kind of client id. I can't see a problem in this, but are there considerations to be made before scrapping multiple schemas in favour of one massive schema?
Otherwise, having some code in place as discussed in the Hibernate article "Manage a separate connection (or pool of connections) for each specific database user" seems like an option.
I just wondered if anyone has any experience of dealing with this issue, what route did you take and do you have any thoughts?
but are there considerations to be made before scrapping multiple schemas in favour of one massive schema?
Yes. Both in technically and even from the perspective of a customer contract. You will certainly find many customers who don't want to "share" their data. If you maintain a single database schema for multiple customers, i am sure they would be concerned.
Yes this is my main concern over this approach also
In the serverside article, it sounds a no brainer......it actually changed my thinking to even consider this approach. Having not been exposed to this kind of issue, i wasn't sure if this approach was a common practice....your comments confirm my initial worries.