Replies: 4 comments 4 replies
-
A few things:
But the biggest reason:
I can see a reason for using something lightweight like SQLite but I think overall the term "database" to me sounds like "extensive data collection", even though that is a flawed notion of the word. Either way, I want this bot to collect the bare minimum amount of data, both for performance reasons (cheap VPS) and for privacy reasons. To flip the question on you, what would be the pros of using a database?
Better in what way?
Not exactly a pro on the database vs json topic 😄
Curious about these! |
Beta Was this translation helpful? Give feedback.
-
I think that remote MySQL or MongoDB support should be added. |
Beta Was this translation helpful? Give feedback.
-
I think as it stands, sticking with JSON will be fine since everything is per-guild. I would love to make the switch to a more abstract storage provider for self-hosters out there, however as it stands, there's no reason to switch off of JSON due to the simplicity here. SQLite would be my choice, but and I think the argument of overhead is negligable since you're also working with a very small footprint of a bot. |
Beta Was this translation helpful? Give feedback.
-
If Needle ever had to shard across multiple machines, a proper database must be used. Postponing that until necessary creates more technical debt to fix later on. Keyv would be a great option for this. Self-hosters can switch database backends with the change of a configuration file. |
Beta Was this translation helpful? Give feedback.
-
Currently, the entire bot uses JSON as a storage interface. While this is cool and all, I offer another solution: SQL.
Pros:
Cons:
While I think there's a lot of work that would need to go into this, I can't help but think about the ability to use SQL in this scenario. As the bot grows, I think there's a greater reward for choosing SQL. Going SQL could be as easy as throwing Prisma at the helm and telling it to store a few fields for now. There's also an automation script that could be ran to migrate from JSON to SQL- this shouldn't be hard to write and can easily be a 1-off script.
I'd be willing to take a crack at this, both in terms of migration to SQL and the backfill to SQL. I've done something quite similar, and it should be straight forward.
Discussion time. What is the reasoning for NOT using SQL? What SQL database do we choose (SQLite, Postgres, Mysql)?
Beta Was this translation helpful? Give feedback.
All reactions