When we start writing an application, in the early stages we don't think about how we will scale it later. Then it is released into production and we understand that it's time to scale it up to cope with the increased workload and improve availability.
What can prevent you from simply launching multiple instances:
- application's cache — simple ConcurrentHashMap or Spring Cache;
- user sessions.
Fortunately, each of these items can be closed quickly if you use the right tools.