3 ms·
What is a real-world use case for this? While beneficial to size I do see a problem with bugs in implementation. A faulty patch apply procedure leads to incorre
by methodin 14y ago
What is a real-world use case for this? While beneficial to size I do see a problem with bugs in implementation. A faulty patch apply procedure leads to incorrect patches when edited, which lead to invalid documents states etc... The benefit, I suppose, is the original document is left untouched. Is there an additional purpose to using patches?
- kennu 14y agoYou quickly run into the need for this if you build an API where clients can update individual fields within JSON documents instead of just replacing the whole JSON document with a PUT. It can probably be argued that each individual field could also be represented by a unique URL, but IMO that makes things pretty complicated and you have to make a lot of unnecessary HTTP requests. I still think it's a mistake to use / instead of . as the separator though. Using . is much more intuitive and it's already used in e.g. MongoDB queries.
- raganwald 14y agoOne real-world use case is differential synchronization. Here's a Google Tech Talk on the subject: https://www.youtube.com/watch?v=S2Hp_1jqpY8 https://www.youtube.com/watch?v=S2Hp_1jqpY8 This is for real-time collaborative editing or replication of structured data (unlike Operational Transformation, which is optimized for text). Sending patches back and forth is at the core of the protocol.
- ericmoritz 14y agoI implemented something like this to notify interested parties in realtime of changes to a shared data element for synchronization. It is basically eventual consistency using op-based CRDTs.