deepstream.io icon indicating copy to clipboard operation
deepstream.io copied to clipboard

Requests for 2.0 listening

Open ronag opened this issue 10 years ago • 5 comments

We've been working a bit on our own deeptream fork modifying it for our specific needs. In particular we are using CouchDB as our storage and conflict resolution framework. However, we would still like to stay as close as possible to deepstream server and if possible maintain some compatibility with the official javascript client. I would like to at least highlight the changes here for future consideration.

  1. We've added the concept that all records exists virtually as {}. There is no such thing as whether a record exists or not and "deleting" a record is essentially the same as setting it to {}. This greatly simplifies a lot of things and allows us to remove the CREATEORREAD, CREATE, DELETE, HAS and SNAPSHOT actions. In particular it resolves some asynchronous races client side.
  2. PATCH and UPDATE messages take a fourth argument which specifies the parent (previous) version. This allows us to implement master-master setups with server merges where versions for PATCH and UPDATE are not guaranteed to be monotonic. If the client receives a PATCH which is out of order he has to issue a READ to receive a complete record. This also allows us to recover from network partitions (#384).
  3. versions are no longer an integer but a string with the following format: ${version}-${uuid}. This is to allow conflicts to be merged even after a network partition.

ronag avatar Oct 21 '16 07:10 ronag

With these changes it would be rather easy to implement offline support in clients using e.g. https://pouchdb.com which has all of that already figured out.

ronag avatar Oct 21 '16 07:10 ronag

We've added the concept that all records exists virtually as {}.

Isn't this essentially the purpose anonymous records serve?

TertiumQuid avatar Oct 28 '16 07:10 TertiumQuid

Anonymous records are a client thing. Not sure how that is related?

ronag avatar Oct 28 '16 08:10 ronag

Not really, anonymous records are useful to change records on the client side while keeping the bindings intact (more about this here).

Records are implicitly created when calling ds.record.getRecord( someName ) however you can check if a record exists using ds.record.has( someName, exists => {})

WolframHempel avatar Oct 28 '16 08:10 WolframHempel

Closing this as things have diverged quite a bit.

yasserf avatar Jul 15 '19 19:07 yasserf