I work on an existing SIM 2.2.0 + JPA (Hibernate 3.3.1) application which is called 'single database per customer' 'The environment where each database schema is the same application, runs on glassfish, uses icefaces, and there are many pages that use interaction. It also uses a single EJB for authentication. Unfortunately, the decision to divide customers into their databases is beyond my control.
As a proof of the concept, I have already been alerted about many databases by transferring the management of Entity Manager for (AIS) management. And in the application using DataSource (S) for special JPA absorption, processing local transactions and threadlocals for reference information. For example, every time a user enters a new EntityManagerFactory, it is initialized using a new datasource which communicates with its database, if it has not already started. It is working well in a test environment, with a handful of databases.
My question is, will this approach be on the scale of hundreds of database? I expect a load balancer to add an application server to handle the extra load, but the hibernate / hibernate / jpa's first-line cache and / or seam reference management (alias, memory consumption) Load a balanced app? If so, can it be reduced by allocating lots of RAM and / or servers with a large distributed cache?
Any insights will be greatly appreciated.
I have worked on an application with this approach and what I can tell is: / P>
- Data source and unit manager Editorial management is the hard part. Although it seems that you used to do this already in the testing environment. If you have done the right thing in relation to Seam Managed Entity Manager, then double check.
- Your application will not be well on hundreds of databases because you have a linear increase of memory consumption for each database. In fact, for each database, you need a lot of RAM for each of the different examples of
EntityManagerFactory (Hibernate
Sessionfinner ). Beware of - Possible matters If you configure the Hibernate second level cache since all session features are created from the same data model, the cache area names may collide. I used the
hibernate.cache.region_prefix configuration parameter to name these names in different instances as a cache prefix using the database id.
- Possible matters If you configure the Hibernate second level cache since all session features are created from the same data model, the cache area names may collide. I used the
Comments
Post a Comment