Having a condition is not a big problem, if done correctly. In any case, all applications have a state. Even if you use multiple static files, the contents of the file associated with the URL are indeed part of the state.
The problem is how this condition spreads and divides.
- The state inside the user session has no problems. Use the session replication mechanism (slower, but without losing the session when the node crashes) or the session limiting load balancer, and your problem is solved.
All other general conditions are indeed a problem. In particular, even the state of the cache must be general and perfectly consistent, otherwise an update on one page can generate different results in a random order, depending on the witch web server and, thus, the cache that you hit.
You can still cache data using shared cached (e.g. ehcache) or not return to the session.
I think itβs quite difficult to make sure that the application will really work in a clustered environment, because a singleton in some obscure service, a static member somewhere, can potentially produce strange results. You can check the overall architecture for sure, but you will need to actually do and perform some validation test before entering production.
source share