If you just started to newly talk to and Event Sourcing/CQRS backend one aspect
might not be obvious for you: optimistic updates are your friend!
From synchronous REST APIs we are used to this: write, read, update. >
A static archive of Markus Tacker's tweets. Follow me on Mastodon: @[email protected].
If you just started to newly talk to and Event Sourcing/CQRS backend one aspect
might not be obvious for you: optimistic updates are your friend!
From synchronous REST APIs we are used to this: write, read, update. >
You write (POST) to change the state of the system and then read the new state
of the system (or get it back right away from the POST), then update the UI
state with what you received from the server. However with ES/CQRS systems you
normally will be done with the write part.
The result of that is an event and if the write is accepted you should
optimistically update your state of the system right away and go on about your
business. This will drastically improve the responsiveness of your UI and save
you a lot of round-trips.