I have a high load app with many users requesting it with various GET params. Imagine giving different answers to different polls. Save vote, show latest poll results.
To mitigate the back pressure issue I was thinking about creating a top-level atom to store all the latest poll results for all polls.
So the workflow is like this:
boot an app => app pulls in the latest poll results and populates the atom.
new request comes in => increment votes counter in that atom for the specific poll, add vote payload to the core.async queue listener(working in a separate thread) to persist it to the database eventually.
The goal I'm trying to achieve:
each new request gets the latest poll results with near-instant response time(avoid network call to persistent storage)
An obvious drawback of this approach is in case we need to redeploy it will result in some temporary data loss. It is not very critical, deploys could be postponed.
The reason why I'm interested in this tricky approach and not just using RabbitMQ/Kafka is that it sounds like a really cool and simple architecture with very few "moving parts"(just JVM + database) to get the job done.