Further Refactoring Our Application
We'd like to now take our application a little further into cloud-native principles. Let's consider that the product manager for our counter app said that we're getting insane amounts of load (and you can confirm this through your observability toolset), and some people are not always getting a strictly increasing number; sometimes, they are getting duplicates of the same number. So, you confer with your colleagues and come to the conclusion that in order to guarantee the increasing number, you will need guarantees around how data is accessed and persisted in your app.
Specifically, you need a guarantee that operations against this datastore are atomically unique, consistent between operations, isolated from other operations, and durable against failure. That is, you are looking for an ACID-compliant database.
Note
More on what ACID compliance is can be found at this link: https://database.guide/what-is-acid-in-databases...