posted 6 years ago
Need some clarifications on the best practises that needs to be followed while updating data into the DB in a spring microservices based webapplication
Scenario
We have a webapplication, in which when the user sends request from the UI, for processing the request, at the backend the request goes to a microservice and we have to update the request and response objects in a particular table in the database. I wanted to know the right approach for updating the data in the databse. Below are my queries.
Should we insert the request Object as soon as we receive it in the microservices orShould we process the request and after the processing, once we receive the response, should we do a single insert to the database with both request and response Object to avoid multiple DB calls.
Please Advise.
Any help on this is much appreciated. Thanks in Advance.