New to Event Sourcing in general but I’ve been reading up for the last couple of months as well as participated in Greg Young’s excellent course in London back in December.
Now: We’re in the planning stages for our next web-application and it’s within a domain where the client is very often disconnected for days or weeks at a time. Hundreds of MegaBytes of data needs to be stored. We have solved this in the past using CRUD & MS Sync Framework + IndexedDB but with this new web-app we’re looking into Event Sourcing. Especially because detailed audit is now of big importance.
I’m just looking for feedback for one of our architectural drafts. With a heavy focus on occasionally-connected-clients it seemed reasonable to have the Command Processor & majority of CQRS API just live on the client-side, handled by a Service Worker. Are we shooting ourselves in the foot here? We’re trying to avoid doubling up with a Command Processor and Event Processor on both client & server. The full-worth Event Processor w/access control etc is solely found on the server.
Another controversial(?) aspect is that we’re thinking about overwriting ‘local’ events (and re-creating read data) once connection with server is re-established. Let’s say I change the name of a person while disconnected. The event is put in the Out-queue but it’s also put into my local Event Store as event #10 (this only happens if we’re disconnected) and Read-models are updated. We keep a track of what’s the latest event that has synced-in from server. Later on however we regain connection with the server and we upload our queued event. The catch-up subscription feeds us back events #10-12 from another client that changed the person’s height etc. Later on our sent event is also received but now as event #13. Our plan is to remove all ‘local events’ (re-setting the state basically) since last-server sync and with the new events coming from the server re-create the read models. Eventually we will also get our sent events back (though maybe with a reversal transaction event applied). Any big warning signs for going down this road?
Here’s the current draft (attached image file):
Would appreciate any feedback.