In our architecture we have a Redis server we use for caching and for publishing event.
My problem is the following
- I have an message called "CustomerUpdate"
- I have 1 application listening to this message
- 3 instance (server) of this application are being executed for scalability
- 1 instance of the database is running
- One of the handler for this message will update the database
- Some other handler will erase memory cache or do something local to the instance
Is there any pattern for making sure that the database is not updated by every instance of the application?