Offline sync and event sourcing : <p>The CRUD-based part of our application needs:</p>

<ol>
<li>Offline bidirectional "two-way" syncing</li>
<li>Ability to modify data until ready and then "publish".</li>
<li>Audit log</li>
</ol>

<p>Event Sourcing (or the "command pattern") is what I'm looking at to accomplish these items. I feel comfortable with solving 2&amp;3 with this, but not clear for item one, syncing. </p>

<p>If timestamps are used for each command (if needed), do the offline commands need to be applied to master system as they would have been in real-time (coalesced), or can I just consider them applied as happening at the end of any command (with a more recent timestamp)? </p>

<p>Any basic algorithm description for command-based sync would be helpful.</p>
