I've been reading recently about Event First approach to microservices where Event Store is a Single Source of Truth for all the applications (https://dzone.com/articles/data-consistency-in-microservices-architecture).
This is very different from Change First approach were we:
- Save item to microservice database (in this scenario that database would be the source of truth)
- On success we send event with change to Event Stream
The Event First approach seems really interesting but there is one thing that's nagging me. How should the change be populated on the front end ?
- We create a new user on the UI. The change is send to BackEnd.
- BackEnd writes the change to EventStore and subscribes to it but the change is not yet populated in its database. Request is returned to client.
- Asynchronously BackEnd tries to add user based on its subscription but it fails.
- On the UI user tries to edit the newly created record. Sends update request to backend. Should we at this point rely on the local database to check if the record exists and return an error ? We have inconsistency at this point and user will know about it but isn't it too late ? Or maybe this scenario is incorrect at some point.