Persistence & database
Store your bot data (SQLite, MySQL, MongoDB) reliably.
Ready to start your service? Check offers and order online.
View offers and orderChoose storage
To keep the data between restarts (economy, levels, configs), choose a suitable database:
- SQLite: simple, local file, ideal to start
- MySQL / MariaDB: robust, multi-access
- MongoDB: document oriented
Connection
- Install the driver (e.g.
better-sqlite3,mysql2,mongoose) - Store identifiers in environment variables
- Start connection to boot start
Good practices
- Never store the identifiers in plain language in the code
- Manage connection errors and reconnections
- Save your database regularly (especially SQLite: the file)
File Persistence
With SQLite, the basic file resides in the server files: it is kept between restarts and included in your backups.