Comments (6)
Personally I do not have wide experience with other server-side / database engines for JSON Patch.
I use Starcounter - besides out of the box JSON-Patch support it serves great performance and together with PuppetJS makes creating single-page MVC app very simple. You can create JSON models just by writing an example .
Here you have an example of the smallest app with this stack: https://github.com/Starcounter/Squared
Maybe @Starcounter-Jack, or @warpech could elaborate more on that.
from json-patch.
I think that in the long term we should see support for JSON-Patch in database drivers. That would reduce greatly the code overhead.
I guess that so far you need to use some server side implementation of JSON-Patch (see GitHub searches for JSON-Patch and RFC 6902) or just parse it as JSON and loop through the incoming patches, while interpreting the input patch-by-patch.
Last year, I have written some server side controllers that loop through incoming patch and respond in a patch (keep in mind they are quite naive and rusty by now):
- Node.JS - https://github.com/PuppetJs/PuppeteerJs/blob/master/examples/basic/app.js
- PHP - https://github.com/warpech/angular-patch/blob/3ab013b49068c250de5e5d9d7c218204fab2c4d9/examples/php/controller.php
In future, we want to work on server side implementations of PuppetJS in more languages, which will greatly improve the programming experience of using JSON-Patch. See the doc: https://github.com/PuppetJs/PuppetJs/wiki/Server-communication
from json-patch.
Thanks for the answers guys and good luck you with working on JSON+Patch. I have the following idea in storing JSONPatch and want to share with you:
Each big JSON document stored as bundle of patches and get compiled when fetching by user. What do you think about this approach?
from json-patch.
I think this is a good solution if your JSON tree represents a single document.
In my case, the JSON tree represents the application view-model (that is: current state of the application including fragments of various documents) so I need to parse incoming patches on server and apply changes in many places.
from json-patch.
@warpech yes if you have to apply patches in many places then my approach is not useful for you. And you're right, my JSON tree represents a single document. Also I want to implement "revision history" feature but can't find good practices around using of Redis. Basically I don't understand which of the Redis data structure type should I use for my purpose.
Could you advise something?
from json-patch.
Closing as answered. I know I haven't answered the last question, but that is quite out of scope of this library.
from json-patch.
Related Issues (20)
- Inefficient patch encoding when prepending to arrays HOT 2
- rrrr HOT 1
- Add performance comparison with jsondiffpatch
- Array patching, over empty elements.. HOT 2
- Any plans for a new release? HOT 1
- Maybe it's already discussed, but anyone think of how to patch array member in a more flexible approach?
- Release 3.1.1 request based on PR merged of #262 HOT 2
- Inaccurate documentation HOT 1
- Error index always 0? HOT 1
- Optional observe callback not called HOT 1
- applyPatch() validator index is not incrementing
- Backport fix for GHSA-8gh8-hqwg-xf34 to v2 HOT 5
- package.json should use `conditional exports`, else esm won't work inexplicitly HOT 1
- Node12+ import documentation incorrect
- Documentation for `generate` mentions wrong signature
- auto add tests to "add/remove" operations like for "replace"
- Mixing default exports and named exports breaks parcel HOT 2
- Attempting to use if mirror has a toJSON and object does not breaks HOT 2
- applying a replace patch is inconsistent with path="" and path="/"
- Is the project dead ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-patch.