Coder Social home page Coder Social logo

Comments (6)

tomalec avatar tomalec commented on June 3, 2024

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.

warpech avatar warpech commented on June 3, 2024

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):

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.

skotchio avatar skotchio commented on June 3, 2024

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.

warpech avatar warpech commented on June 3, 2024

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.

skotchio avatar skotchio commented on June 3, 2024

@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.

warpech avatar warpech commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.