domain driven design - Multi-Version Concurrency Control and CQRS and DDD -


in order support offline clients, want evaluate how fit multi-version concurrency control cqrs-ddd system.

learning couchdb felt tempted provide each entity version field. there other version concurrency algorithms vector clocks. made me think maybe, should not expose version concept each entity and/or event.

unfortunately of implementations have seen based on assumption software runs on single server, timestamps events come 1 reliable source. if events generated remotely , offline, there problem local client clock offset. in case, normal timestamp not seem reliable source ordering events.

  1. does force me evaluate form of mvcc solution not based on timestamps?

  2. what implementation details must offline-cqrs client evaluate synchronize delayed chain of events central server?

  3. is there opensource example?

  4. should ddd entities and/or cqrs query dtos provide version parameter?

i manage version number , has worked out me. nice thing version number can make code explicit when dealing concurrency conflicts. approach ensure dto's have version number of aggregate associated with. when send in command has current version seen on client. number may or may not in sync actual version of aggregate, ie. client has been offline. before event persisted check version number 1 expected , if not check against preceding events see of them conflict. if do, raise exception. fine grained form of optimistic concurrency. if interested i've written more detail including code samples on blog at: http://danielwhittaker.me/2014/09/29/handling-concurrency-issues-cqrs-event-sourced-system/

i hope helps.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -