[HN Gopher] What's the Difference: JSON diff and patch
___________________________________________________________________
What's the Difference: JSON diff and patch
Author : ggleason
Score : 30 points
Date : 2022-02-16 16:27 UTC (6 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| bradjonesca wrote:
| The ability to accommodate CRDT's in the architecture (future) is
| a gamechanger
| littlestymaar wrote:
| > web3
|
| oh no.
| dang wrote:
| " _Please don 't pick the most provocative thing in an article
| or post to complain about in the thread. Find something
| interesting to respond to instead._"
|
| https://news.ycombinator.com/newsguidelines.html
| xeromal wrote:
| How are you everwhere, dang?
| littlestymaar wrote:
| Honestly, I don't think this applies here, given this is the
| first sentence:
|
| > What will the distributed data environment in Web3 look
| like?
|
| As a web developer, I expected an interesting JSON-related
| post, so I was kind of disappointed by the intro (and it's
| not just the first sentence, the entire introductory
| paragraph talks about "web3")...
| ggleason wrote:
| Surely JSON is going to be an important component of Web3.
| Web 2.0 was bringing the application to the browser. Web3
| is going to be about distributed data architecture and JSON
| is going to have a big place in that.
| littlestymaar wrote:
| In case it wasn't clear from my comments above: I don't
| doubt JSON may be important for this "definitely-not-the-
| web"-3. I just don't care about it, and neither does a
| good half of web developers here on HN.
|
| (And yes, I'm also a bit angry because a bunch of lazy
| marketing dudes decided to hijack the "Web" name for
| something which has nothing to do with the web...)
| ninja_daro_yco wrote:
| We already have json patch(http://jsonpatch.com/) and we can sent
| diffs as json patch document, so I don't understand what is the
| purpose of this proposal.
| ggleason wrote:
| We use JSON-patch/diff internally for our rebase operation. We
| looked at implementing it on rfc6902 but it turned out to be
| awkward because of the path descriptions, and insufficiently
| rich for the kinds of patches that we needed. We could have
| extended rfc6902 but then we'd be in the embrace / extend /
| destroy pattern no?
| LukeEF wrote:
| TerminusDB person here: we were using the API internally for
| our immutable collaboration database service [1] so we thought
| we'd make it available for others to use. We think it is better
| than the one derived from the RFC and built specifically for
| collaboration, but you can be the judge of that! In any case -
| choice is good, right?
|
| [1] https://terminusdb.com/
| skrtskrt wrote:
| We also have JSON Merge Patch (https://www.rfc-
| editor.org/rfc/rfc7396), and both have very little adoption
| (judging by the available libraries & integrations)
|
| I haven't used any of these yet, I've been waiting for one to
| obviously "win " and gain some support, but have definitely
| felt the pain.
|
| Use case: Sending a Kafka message to add or remove a value from
| an array field without having to know the rest of the array
| Bjartr wrote:
| For a(n anec)datapoint, I'm using JSON Patch in a production
| application.
| smarterclayton wrote:
| Kubernetes supports both JSON patch and merge patch, and it
| has been a continuous source of amazement to me (in the
| "that's a bloody giant hole in the ground" sense) of how hard
| actually calculating, representing, and developing durable
| intuition about finding differences between and merging JSON-
| like trees (empty lists, null vs empty, representing
| insertion vs deletion, lists with primary keyed members, list
| uniqueness, field ordering, duplicate fields, number
| equivalence, etc).
|
| Add in defending against pathologically malformed patches -
| several vulnerabilities were discovered in the golang patch
| libraries Kube used - and one starts to develop a twitch
| whenever it is mentioned...
| ninja_daro_yco wrote:
| Actually we are using json patch/json pointer extensively to
| limit data sent through network or update live data on a
| client(its embedded world). If user is changing single
| parameter on a client we sent just json patch as defined in
| RFC(including arrays modifications). Libraries are mature and
| simple to use(on client, on server we are using C++ so I
| suppose its a in house solution), thats why it's hard for me
| to understand why we need another solution for the same
| problem. Having said that I haven't used them in Kafka world.
___________________________________________________________________
(page generated 2022-02-16 23:02 UTC)