the-guard-bot icon indicating copy to clipboard operation
the-guard-bot copied to clipboard

[database] Add MongoDB support (but leave fiat-based DB intact)

Open ajhalili2006 opened this issue 4 years ago • 4 comments

About this Issue

This will resolves #91 for Heroku users who hates getting some add-ons to support persistent storage. This will also lessen the hassle of moving between servers. While @trgwii don't want to burden us with installing MongoDB (or looking on where we can host our MongoDB instances to use this lightweight bot) and this may make an Raspberry Pi rekt if we self-host MongoDB there, I would like to leave the fiat-based DB intact so advanced users can migrate/use to MongoDB without being limited by the filesystem.

Related card from project's mainboard

  • https://github.com/thedevs-network/the-guard-bot/projects/1#card-6825777

ajhalili2006 avatar Jun 25 '20 09:06 ajhalili2006

We don't want to burden our users with installing MongoDB in order to use this relatively lightweight bot. Currently this bot can run fine on a Raspberry Pi, that would not be the case if we migrated to Mongo.

trgwii avatar Jul 27 '20 06:07 trgwii

If we decoupled the database logic, we'd be able to allow some heavy users to use/migrate to Mongo while keeping nedb support. Because nedb and Mongo are very similar, it might not be too difficult to have a layer of indirection. It'll also allow the users who want to use a PaaS like Heroku (#91) to run the bot without being limited by fs.

I'd say it's not a priority, but we can leave this ticket open for now.

MKRhere avatar Jul 27 '20 07:07 MKRhere

I was about to say the same, database layer should be abstracted so that we can easily switch between various document databases

faizanakram99 avatar Jul 27 '20 07:07 faizanakram99

Based on the feedback @MKRhere and @faizanakram99 posted earlier, I would agree to keep the nedb support even there's MongoDB. I'll update the title and description of this issue to reflect these changes.

ajhalili2006 avatar Jul 29 '20 08:07 ajhalili2006