<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>That is what I suggested, but then at the same time connect that to pipes and stores, but we can start even simpler and first develop something like this.</div><br><div><div>On 11 Dec,2013, at 10:37 , Daniel Bevenius &lt;<a href="mailto:daniel.bevenius@gmail.com">daniel.bevenius@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">First, I appreciate the discussion in this thread as this is all new to me.<br><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">&gt; What use cases should we support first?</span><br>

</div><div><span style="font-family:arial,sans-serif;font-size:13px">I'd be for looking into the document use case first, and hold off with the transactional/Operational Transformation one for now. This mainly because is seems to be a lot simpler.&nbsp;</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">qmx suggested using something similar to CouchDB. CouchDB uses a revision field for each document to handle/detect conflicts.&nbsp;</span></div><div><span style="font-family:arial,sans-serif">The following is a concrete example of how this works with CouchDB:</span><br>
</div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Create a database:</font></div><div><font face="arial, sans-serif">curl -X PUT <a href="http://127.0.0.1:5984/agsync" target="_blank">http://127.0.0.1:5984/agsync</a></font></div>

<div><font face="arial, sans-serif">{"ok":true}</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Get a uuid:</font></div><div><font face="arial, sans-serif">curl -X GET <a href="http://127.0.0.1:5984/_uuids" target="_blank">http://127.0.0.1:5984/_uuids</a></font></div>

<div><font face="arial, sans-serif">{"uuids":["f11075199bcea80849204660d7000d53"]}</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Create a car object(document) using the above uuid:</font></div>

<div><font face="arial, sans-serif">curl -X PUT <a href="http://127.0.0.1:5984/agsync/f11075199bcea80849204660d7000d53" target="_blank">http://127.0.0.1:5984/agsync/f11075199bcea80849204660d7000d53</a> -d '{"car": {"make":"Toyota", "color":"red"}}'</font></div>

<div><font face="arial, sans-serif">{"ok":true,"id":"f11075199bcea80849204660d7000d53","rev":"1-dffbd1dbd1b9ecbffc1b02a34cbaea0b"}</font></div><div><font face="arial, sans-serif"><br>

</font></div><div><font face="arial, sans-serif">Notice that the server returned a new document revision.</font></div><div><span style="font-family:arial,sans-serif"><br></span></div><div><span style="font-family:arial,sans-serif">Now clientA updates the car object, notice that we are specifying the document revision:</span><br>
</div><div><font face="arial, sans-serif">curl -X PUT <a href="http://127.0.0.1:5984/agsync/f11075199bcea80849204660d7000d53" target="_blank">http://127.0.0.1:5984/agsync/f11075199bcea80849204660d7000d53</a> -d '{"_rev":"1-dffbd1dbd1b9ecbffc1b02a34cbaea0b", "car": {"make":"Toyota","color":"blue"}}'</font></div>

<div><font face="arial, sans-serif">{"ok":true,"id":"f11075199bcea80849204660d7000d53","rev":"2-588a9da2e252e9a3d2fc0634610a0c25"}</font></div><div><font face="arial, sans-serif"><br>

</font></div><div><font face="arial, sans-serif">Also, notice how the server returned a new document revision.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Now, clientB still has the old revision and tries to update the car object:</font></div>

<div><div>&nbsp;curl -v -X PUT <a href="http://127.0.0.1:5984/agsync/f11075199bcea80849204660d7000d53">http://127.0.0.1:5984/agsync/f11075199bcea80849204660d7000d53</a> -d '{"_rev":"1-dffbd1dbd1b9ecbffc1b02a34cbaea0b", "car": {"make":"Toyota","color":"yellow"}}'</div>
<div>&lt; HTTP/1.1 409 Conflict<br></div><div>{"error":"conflict","reason":"Document update conflict."}<br></div><div>This conflict would the have to be handled by the client.&nbsp;<span style="font-family:arial,sans-serif">Could we start out with something similar and as simple as this and evolve it?&nbsp;</span><span style="font-size:13px;font-family:arial,sans-serif">&nbsp;</span></div>
</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 11 December 2013 08:30, Erik Jan de Wit <span dir="ltr">&lt;<a href="mailto:edewit@redhat.com" target="_blank">edewit@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">&gt;<br>
&gt; Just because I want to start with a simple use case doesn't mean you can<br>
&gt; dismiss the use case.<br>
&gt;<br>
<br>
<br>
</div>I don’t want to dismiss anything just wanted to know what you think about my idea to combine a pipe and store to create a pipe that continues to work when the user goes offline. Obviously you don’t feel my idea makes any sense and I think that you sync isn’t a super powerful feature to have (there are to many pre conditions in my opinion), but we could have it, not dismissing it.<br>

<br>
What do others think about this discussion? What use cases should we support first? Can you think of other ways/things to sync?<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
</div></div></blockquote></div><br></div>
_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/aerogear-dev</blockquote></div><br></body></html>