Giter Site home page Giter Site logo

Comments (8)

BrunoScheufler avatar BrunoScheufler commented on May 5, 2024

Well I think that really depends on the data source you're using. Whether you use SQL or NoSQL databases like MongoDB etc. greatly changes the result

from nodebestpractices.

elouizbadr avatar elouizbadr commented on May 5, 2024

@BrunoScheufler I am using the MEAN Stack so it's NoSQL with MongoDB.

from nodebestpractices.

goldbergyoni avatar goldbergyoni commented on May 5, 2024

@elouizbadr interesting and relevant case.

can you elaborate on your specific use case: what data, why not simply delete physically, what constraints (e.g. have 5B records, deleting will overaload the system)

Milestone added

from nodebestpractices.

elouizbadr avatar elouizbadr commented on May 5, 2024

@i0natan Thank you for considering this matter.

I am working on project that automatically deploy applications that were developed by company teams, to a private cloud hosted on a 3rd party provider. I have data objects like Servers, Infrastructure, Applications, Instances ... etc. The issue here is that I want to protect data from being deleted accidentally and for further restoration. Even though on my AngularJS Front End the admin should confirm every time he clicks on the "Delete" button, but that's not sufficient.

Me and my team have talked about email confirmation, using separate MongoDB collection for "deleted" stuff,or even a complete separate database for them ... and so on.

In addition to that, Users may want the "undo" or "redo" functionality so it's relevant to this issue.

from nodebestpractices.

syzer avatar syzer commented on May 5, 2024

@elouizbadr
The historical tables for mongo collections are quite common solution for that case.
there are plugins for most mongo object mappers that do that automatically

The downside is that adds so much IO overhead.. but it might not be important in that particular case.
Example if your organisation uses ruby python it would not notice performance difference.

Also I would highly recommend reading about lenses, clojure, and immutability in general
and about using event sourcing.

For also using redux/flux/graphql architecture (AKA event sourcing/modern stack), would solve your particular case.

But every case is different, so would go with lazy-ass solution(historical tables) and change architecture only when you need specific needs.
ex: transactions

from nodebestpractices.

elouizbadr avatar elouizbadr commented on May 5, 2024

@syzer Very grateful for your comment and suggestions.

I'll check on every one of your suggestions in order to choose the one that fits my project requirements.

from nodebestpractices.

syzer avatar syzer commented on May 5, 2024

Generally functional approach to Undo is trivial.
OOP is quite complex.
Do not forget about transaction support if its required.

from nodebestpractices.

goldbergyoni avatar goldbergyoni commented on May 5, 2024

@syzer covered it perfectly. Simply put event sourcing or any kind of append-only (doc per-version, no updates, avoid calcualting deltas) seems like the sweet spot between implementation complexity and performance (sacrifice storage but you can work around this with periodical deletion).

This post summarizes it well:
http://www.askasya.com/post/revisitversions/

from nodebestpractices.

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.