Comments (8)
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.
@BrunoScheufler I am using the MEAN Stack so it's NoSQL with MongoDB.
from nodebestpractices.
@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.
@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.
@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.
@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.
Generally functional approach to Undo is trivial.
OOP is quite complex.
Do not forget about transaction support if its required.
from nodebestpractices.
@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)
- Easy to translate advice HOT 1
- Translations status HOT 1
- Bonnes pratiques nodejs
- Arabic Translation
- Node practice 1
- Should include Corepack in our recommendation? HOT 5
- Bootstraping nodejs container may be misleading
- Node
- Node js fullstack HOT 4
- Wrong example HOT 2
- Broken link to env-var
- Nextjs as main framework? HOT 2
- Another comment regarding "1.1 Structure your solutions by business components" HOT 1
- Italian Translation
- The backend-testing-checklist.png file is missing. HOT 3
- Hinglish Translation HOT 1
- Кнас
- Dead link for safe-regex
- Mi006
- Is using cache for npm install in docker safe?
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 nodebestpractices.