#Best choice for simple db

11 messages · Page 1 of 1 (latest)

final magnet

Hello,
Just wondering what are some of the best choices for very simple database where you can use a command to set a channel as a logging channel or something like that?
I don't see myself using it for much else right now but storing basic per-server info but it being relatively scalable never hurts too.

I'd prefer something free to use of course - I heard mongodb free tier isn't so bad but not sure.

Thanks!

dense swift

quick db is horrible

final magnet

I'll look up quick db although that is conflicting messages xD Aetherna do you have any suggestions?

dense swift

Mongo is fine for what you want

shadow nest

sqlite is way easier to setup but sure

scenic dirge

@final magnet the answer of "best choice" is unfortunately not as simple as it sounds, because the real answer is: it depends.

if you have relational data, consider a relational database (usually SQL) aka "a user has a guild, which has a config, which can have references to other users for permissions"
to get started sqlite is a single-file database, where the module itself does all the transaction management and file locking
once you want to scale up, transferring to another database with a dedicated schedule manager (postgresql, mysqyl (mariadb as an open source fork of that))
note that sqlite is fine for a really, really, really long time, discord bots are usually not that demanding, once you do hundreds of reads per seconds you should definitely consider that

if you have non-relational data aka "i just need one json data object per guild to save settings" (can be more complex than that) a file-based database like mongoDB can be the right choice

(i would personally recommend against quickdb, but that's honestly personal bias with how much issues we've had with them being recommended by really bad bot tutorials online and how they tackled criticism with their method and various errors we have found when looking into it - that might have been remedied already)

at its core, quick.db is a key-value store that wraps around a persistent relational database for more object-like access patterns - i personally think it is worth the fuzz of learning sql or using mongo over this, and if just to broaden your skillset with industry standard approaches

final magnet
scenic dirge <@173646314083450881> the answer of "best choice" is unfortunately not as simple...

Thank you for the thorough reply! I've thought about what I want to do more and it'll be a bit more of a fleshed out logging system. It won't be overly complex but I'd need to save stuff like the logging channel information, any whitelisted or blacklisted channels when logging, any roles/users to ignore, etc.

I don't have an issue learning/using SQL. I don't know if this kind of data is considered relational or not though tbh.

scenic dirge

to me, all you listed so far sounds not very relational (logs are usually chunks of data rather than relational, and settings/configuration files are associated with a single key (the guild id) as well. unless you have any data that relates to that guild heavily (users, roles, permissions, channels) i'd not call that deeply relational yet)