Is it possible to have replicated JVMs so that I can just flip from primary jvm to secondary, in case primary jvm goes down

Is it possible to replicate the full JVM, and in case of failure, just turn the load on the replicated JVM?

If so, how can we do this?

+4
source share
3 answers

In case your application is a web application, read Clustering and Load Balancing. Most application servers support clustering.

You can also look at JGroups, which provides data exchange between JVMs.

+2
source

This is not what is done at the JVM level, but there are many products that handle this when processing messages. This is usually an Enterprise Service Bus feature. Google and you will get some ideas.

+1
source

Yes, in theory, but the main problem would be that your applications would be much, much slower (for example, from 100 to 1000x), and this is what causes most people to perform full replication.

Instead, you need to create a data stream from important pieces of information, for example. all incoming or outgoing messages (or both) and send them to a second computer and rebuild the state from existing data.

BTW: When you lose the TCP connection to the server, they should be closed and reconnected. They do not fail transparently. UDP avoids this problem without having connections, but it is much more difficult to work with reliability. One way is to have a simple proxy / load balancing server located between the client and the server. Because it is simple, it is less likely to fail, and it hides the server connection. However, if you have a data center malfunction, it will also disappear.

+1
source

Source: https://habr.com/ru/post/1388104/


All Articles