I would like to know which template is recommended for working with a counter representing the number of processed messages, with an application that should be stateless.
For example, in an architecture where an application is deployed on multiple servers, the database is used to store persistent information (session, etc.). However, such information is not subject to parallel updates, for example, a message counter. In a mono-instance application, we can use singleton, but this is not the case here.
What will be your proposal for the implementation of such a counter? Does the counter use a bad design?
source share