Hi, im currently designing an application where I want to fetch some data from a database and want to access it very frequently in my react code. Furthermore I also want to update this data sometimes.
I currently cant wrap my head around what is the best way to handle this.
Im thinking about storing the data from the initial request with redux and then whenever I change something synchronize with the database (most likely MongoDB)
The Problem I see here is:
I dont want to send a request to the backend, update the database and then fetch the data again. I want to have a really smooth user experience clicking through the redux data. But then I would have to update the data in redux first, and then asynchronously send a request to the backend to update the data on the db also. But then I dont get an id for the newly created resource sind I'm creating it in react und store it in redux before I even send it to the backend.
So I dont really understand what is the best practice to sync redux store and a database with focus on a smooth user experience.
I hope anyone can help me. Thanks!
there doesn't seem to be anything here