0

So I was wondering how following problem would be solved best in a JPA/JavaEE enviroment:

Imagine you have multiple stores, each equipped with a separate database (but the same domain structure). Every night all databases are going to be interrogated by a main HQ Server and some calculations are done.

In my opinion, the best solution would be:

  • Timer which schedules the interrogation.
  • Multiple DataSources for each store
  • Maybe some producers (for each store one) to use deltaspike data.

Is there a way to reduce the overhead of multiple configuration and PersistenceContexts to use the same operations on all databases? Like some sort of strategy pattern for JPA?

calaedo
  • 313
  • 1
  • 3
  • 15
  • ([**Multi-tenancy**](https://en.wikipedia.org/wiki/Multitenancy) might be the search key you are looking for.) – Joop Eggen Aug 31 '15 at 13:03
  • All i find are references on multi-tenancy for single databases, but in my scenario there are multiple databases. – calaedo Aug 31 '15 at 13:31

1 Answers1

0

I had the same problem and this post Multi-tenancy I helped me solve it.

Randy Hector
  • 89
  • 1
  • 1
  • 9