Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a better database #19

Open
500-internal-server-error opened this issue Mar 27, 2023 · 5 comments
Open

Use a better database #19

500-internal-server-error opened this issue Mar 27, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@500-internal-server-error
Copy link
Contributor

Currently, the bot uses a plain array to store session data. This makes the sessions "database" ephemeral and prone to disruptions (e.g., if the bot crashses while in the middle of a session, that session data is lost, as if the session was never started).

One solution would be to make use of sqlite as a more permanent database, allowing sessions to be resumed should they be interrupted for whatever reason. While it has never happened before as of the writing of this issue, it is a good precaution to take.

@500-internal-server-error 500-internal-server-error added the enhancement New feature or request label Mar 27, 2023
@istamarahsan
Copy link
Member

sqlite might be too overkill for such a scenario. Since the current implementation is just an in-memory key-value store, why not swap it out for an embedded one like RocksDB? levelup is an NPM package for interfacing with KV stores including RocksDB.

@500-internal-server-error
Copy link
Contributor Author

An alternative database is fine, as long as it's persistent, i.e., session data is not lost should the bot crash / be shut down for whatever reason.

@istamarahsan
Copy link
Member

Right, then I'll get started on this find someone to assign this to.

@istamarahsan
Copy link
Member

Use a Redis db as a buffer for completed sessions.

@alfonsusac
Copy link
Member

Gw saranin langsung pake Prisma + Supabase/Neon aja

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants