-
Notifications
You must be signed in to change notification settings - Fork 8
Be offline first #184
Comments
I agree with you that Being offline first should be the way to go. This comes for free with PouchDB and CouchDB but we don't have direct access to CouchDB from Daybed. Also we may want to do validation on sync so we will need to proxify storage calls. Can we make daybed syncable with CouchDB/PouchDB and add a validation models on it? |
I've read http://guide.couchdb.org/editions/1/fr/consistency.html#study and it seems to me that we "just" need to add a In that case we will never override anything because the storage backend will fail if the current |
Some more thoughts about that:
|
I am ok to implements our own if it stay as simple as the CouchDB one. |
One thing we discussed with @Natim while cycling (yeah, we do that), is the ability to roll our own syncing engine, that would not be tied to Daybed as it is. This means the scope of the project would remain small: just deal with validation of data and permissions, and we would have a syncing engine atop of it that would allow us to sync data. The pre-requesite for this to be a valid schema is that one doesn't need to know the data structure in advance to be able to do syncing. I believe that's true because of how couchdb does (there is no schema so it cannot be known!) Doing this allows us to look at already existing syncing mechanisms, and would mean we do a post-syncing task, to filter the data we may not want (because it doesn't validate for instance). Details to come ;) |
Loopback does their own replication themselves. The documentation isn't really clear as to how this is done in the backend, but we could benefit from some of the investigation they did. |
If conflict resolution is a thick topic to be managed by the server, we could at least :
See http://python-eve.org/features.html#data-integrity-and-concurrency-control |
I was viewing a video about being offline first, talking about how Hoodie works and what's the rationale behind their design and I was wondering how we wanted to handle syncing for daybed.
Daybed, for most of it, is doing validation of the data given a schema you define beforehand. One thing we want to add, though, is a way to sync between clients. And one thing I would like to do is to be offline first. In other words, I would like to be able to define some data locally, validate and store it, and then sync it really easily.
On key point of the conference Alex gave (the video I linked) is the fact that syncing is hard, and that we probably don't want to do that ourselves. To avoid that with Hoodie, they use CouchDB and its replication mechanism.
I'm not sure how that works specifically in their case, and if that would be possible to use Hoodie database or PouchDB for instance, but I believe we would like to reuse something existing rather than starting a new syncing engine (because if something exists that would make sense to reuse it).
One thing that came up is that we don't want to trust clients. But that's something really hard to accomplish in our case it seems.
How do we do syncing if we cannot trust the clients? Should we re-validate all the fields that the client sent us?
I would like to use this issue to discuss how could we do offline first for daybed. It's all about the API we want for daybed.js (do we want to reuse something already existing? Do we want to roll our own?) and how do we do the syncing part.
Let's discuss!
The text was updated successfully, but these errors were encountered: