couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Re: JSON Patch Internet Draft 01
Date Fri, 10 Jun 2011 01:03:33 GMT
To play devil’s advocate: Is this format really necessary? From the draft:

>    The HTTP PATCH [RFC5789] specification extends HTTP with a new method
>    to perform partial modifications to resources.  A JSON-based patch
>    document type is required to modify JSON documents using this method.

That’s not strictly true. A generic delta format such as xdelta3 or zdelta can be used to
patch any type of resource at all (and frequently is, in apps like software updaters.)

I can see that an advantage of JSON Patch is that, since it describes structural changes rather
than byte-level changes, it works even if the physical representation of the JSON changes
(i.e. modifications to whitespace or Unicode character encoding.)

I’m just unsure whether that’s a significant enough advantage to outweigh the drawbacks,

- Much more verbose than xdelta3 or zdelta
- More CPU-expensive to patch
- Requires new software to generate and apply patches, rather than using existing delta libraries
- Has no error checking, so version mismatches could result in uncaught document corruption

View raw message