I am working on a web application that has historically been built on the PHP / MySQL stack.
One of the key operations of the application was to perform some heavy calculations, requiring the repetition of each row of the entire database table. Needless to say, this was a serious bottleneck. Therefore, it was decided to rewrite the entire process in Java.
This gave us two advantages. First, Java, as a language, was much faster than the PHP process. Secondly, we could support the entire data set in the memory of the Java application server. So, now we can do heavy calculations in memory, and everything happens much faster.
This worked for a while until we realized that we needed to scale, so we now need more web servers.
The problem is that according to the current scheme, all of them must maintain the same state. All of them query the database, process the data and store them in memory. But what happens when you need to change this data? How do all servers maintain consistency?
This architecture seems to me wrong. The benefit of storing all the data in memory is obvious, but it makes scalability very difficult.
What are the options from here? Switch to data storage in memory, key value? Should we completely abandon the storage state inside the web servers?
web-applications architecture scalability
Yuval Adam
source share