Occasionally Connected Sites

Several of my clients have the scenario where they have a main office and remote sites. Currently, everything funnels back through the database and services at the main office. The app they use to manage their business is being considered for redesign as occasionally connected due to unreliable connectivity from the remote sites to the main office.

So I am curious about the requirements to use Event Store for this type of scenario. I’m assuming I would have Event Store on a server at the main office and on a server at all remote sites so they could continue to operate when the intranet link was down and replication would be setup between them. How would replication conflicts typically be raised and dealt-with?

Kasey

This is a scenario that has been thought of. As of now the replication
that is done is done through quorum based writing for consistent
writes. As such a partitioned node would not be able to accept writes.
This can however be handled relatively easily at an application level
with merging. I did a talk about how to handle this at skillsmatter
http://skillsmatter.com/podcast/design-architecture/cqrs-not-just-for-server-systems

The basic idea is that the app will accept writes while offline (into
a queue) then will push them when the server is available to do a
consistent write. The server is the book of record. The app handles
merging (oddly this is how git works pull before push)

We have talked about adding a feature to allow a partitioned event
store to accept writes if given expectedversion.any for the version
number. However this feature will not be in the initial release.

What could be done now is to deploy to all sites. Each remote branch
has a local copy of data. Writes queue at app layer if not online.
When online writes push to main branch (and local gets updated).

Does this make sense?

Cheers,

Greg

I have watched that video in the past, but it’s unclear to me how exactly to merge events (probably more a question for the DDD/CQRS group). Particularly, how to merge when two different events on two different servers separately generate the same aggregate version (assuming it’s an integer). AFAIK, the event stream should not be edited to fix version numbers, so how to handle the merge eludes me.

In that video the client will cache commands so what you discuss here can’t happen. There is only one book of record.