Page 1 of 1

Does BroadLeaf support multiple database nodes?

Posted: Thu May 16, 2013 10:17 am
by sivaprasadreddy.k
Hi,
We are evaluating broadleaf commerce for our e-commerce platform migration from perl to java. BroadLeaf looks promising among the available options.

In broadleaf database schema design, all catalog, products, orders etc are all in one database and the code is written in such a way that core components have PersistenceUnit "blPU" is injected through annotations for DaoImpl's and Transaction demarcation also done using @Transactional("blTransactionManager") which utilities "blPU".

But for our application, we want to have catalog, product etc data in one database schema and order, customer details needs to be stored in a different database/schema. This is because catalog/product details will be read more frequently, so we want to have multiple database nodes with replication strategy along with load balancer.

My question is, is there a way to extend or tweak broadleaf framework to work with multiple databases/schemas?

Re: Does BroadLeaf support multiple database nodes?

Posted: Tue May 21, 2013 3:47 pm
by phillipuniverse
A lot of our order domain (specifically order items) reference things from catalog like Product and Sku. Most database do not support cross-schema foreign keys, so that would be the major hurdle preventing splitting this out.

Secondly, you would also have to set up some sort of 2-phase commit process if you ever run into the scenario where you need to write to both databases at the same time. Pretty sure this is possible, but I'm not sure of anybody using Broadleaf that has needed this scenario.

I think that the first issue actually makes what you want impossible, unless there is something in Hibernate that can resolve these foreign key references.

Re: Does BroadLeaf support multiple database nodes?

Posted: Tue May 21, 2013 3:50 pm
by phillipuniverse
You could also get around this by turning on caching properly.

Re: Does BroadLeaf support multiple database nodes?

Posted: Tue May 21, 2013 8:27 pm
by sivaprasadreddy.k
Thanks for your reply and You are correct about foreign key relationships among order and catalog tables.
Regarding caching, we are thinking of using Terracotta's BigMemory with EHCACHE. But it seems cache configuration xmls are there in broadleaf core component jars.

Is it possible to override that cache configuration using merge process, ie by declaring cache configuration with same spring bean id in my application config files?