We know that we want to use the cache as a draft database, where all information can be consumed immediately, and only later consolidate our data in the database effectively.
Let's understand a little about the internal flow of persistence by looking at the following points:
- This executes a request to the application.
- Information sent to the application is registered in two places when it comes to POST/PUT/DELETE. The first is the cache, where it will be all the information sent in the request. The second place is the queue, where it will be an identification key to the cached information.
- The workers start and check if there is some content in the queue.
- If there is content in the queue, the workers seek the data in the ...