New package – jam:archive – An easy way to add an archive mechanism

jam:archive is an easy way to add an archive mechanism to your app. It’s an alternative to soft deletes. When a document is archived, it’s removed from its original collection and placed in an archive collection so that it can be restored if needed. Its key features are:

  • Zero config needed (though you can customize)
  • Isomorphic so that it works with Optimistic UI
  • Automatically overrides removeAsync to perform an archive (can be turned off)
  • Explicitly archive with archiveAsync collection method (optional)
  • Restore archived docs with restoreAsync collection method
  • Optionally exclude specific collections
  • Compatible with Meteor 3.0.2+
  • Seamless integration with jam:offline

If you end up giving it a go or have ideas on how to make it better, let me know!

11 Likes

An interesting approach. I have been using soft delete for most thing never though about an archive collection. The downside of that is when you want to do some analysis including the archived data, on the other hand I’m wondering if this approach can have performance improvements on the original collection which is now unburdened by the soft deleted files.

2 Likes

Yeah I think there are tradeoffs. I like the cleaner approach of archiving and plan to use it going forward unless I have a really good reason not to. I came across this article a while back which got me thinking about it: To delete or not to delete - practical data archive in database design.

2 Likes