Spring statemachine JPA with multiple JVMs and a shared database - spring-statemachine

Are there any patterns for running Spring statemachine JPA with multiple VMs (Highly available apps) and a shared database or is distributed coordination such as Zookeeper always required for >1 VM
Thanks in advance
Si

Related

Does Spring Boot supports Master Slave config of RDBMS DB

I have a multiple Spring Boot based Micro services which connect a DB2 data base (Master BD). We want to have same replica of Master DB which is called Slave DB2 DB. Every month we have some maintenance on master DB for 5-10 hrs during this time we want all our apps to automatically connect to Slave DB after this time period apps should switch back to Master without manual intervention.
Is this possible to achieve in Sprint Boot. I thought of using Spring Cloud Hystrix but is it correct architectural pattern. Any other better approach.
It's possible to do this on the infrastructure level, your apps does not need to know that there was a failover.
If you want to solve this on the application side, you can use Spring Cloud Circuitbreaker (Hystrix is deprecated, but you can use it with Resilience4J).

Is it feasible to use database-per-tenant with 1000 tenants?

I would like to build a multi tenant Spring Boot application. I prefer persisting the data for every tenant in a separate database.
This approach implies the usage of a data source (and a connection pool) for each tenant/database.
In my scenario I have about 1000 tenants. Does anyone have experience with having 1000 connection pools in a Spring Boot application?
What do you recommend for such a scenario?
Thanks!

What should be the TransactionIdPrefix for multiple spring boot consumer/produces apps which are connected to kafka (3 brokers))

I am having multiple spring boot applications which are connected to kafka (clustrized with 3 brokers)and also i integrated transaction synchronization (chainedKafkaTransactionManager). so i want to know should i give the same TransactionIdPrefix value in kafka config for all the multiple application or diffrent one.
i tried giving a random generated TransactionIdPrefix for each application. but i think in some time in multi thread environment in Listeners method it will take old data from database (jpa repositories)
is it problem because of diffrent TransactionIdPrefix ?
It depends; if they are multiple instances of the same app and the transactions are started by consumers, the prefix must be the same, so that zombie fencing is handled properly when partitions move from one instance to another after a rebalance.
If the transactions are started by producers, the prefix must be unique in each instance.
If they are different applications they should have different prefixes, regardless of what starts the transaction.

How to setup tree cache in tc server

I want to migrate an aplication which is currenty runnung in jboss 7 to tc server 2.9.6. In jboss we were using infinispan tree cache for caching. Is it possible to set up the same for tc server or I have to use any other caching techniques in tc server ?
Migrating projects from one container to another is often problematic. Not as much with Infinispan
This article(https://dzone.com/articles/how-configure-infinispan) is about configuring Infinispan, using Transaction Manager for demarcating transaction boundaries, while keeping the data both in a memory and relational database.

Spring JPA transaction in clustered environment

I use Spring-JPA in my application. I use container managed option for EntityManager and use JTA transaction manager.
this Java EE application is deployed in JBoss clustered environment, will the isolation of transactions be taken care of?
In other words, will two different requests on different JBoss nodes and two different request processed on one JBoss node behave differently in isolation perspective?
The transaction isolation behaviour and limitations are dependent on the database provider. Now if your using Oracle RAC , I haven't seen issues but on a MYSQL instance this is an issue.

Resources