Start with SQLite for one process
A team assistant that stores a few channel preferences can use SQLite in the deployment’s persistent files. Create the database in a dedicated directory, such as data/slack.sqlite3, outside generated build output. Ignore the database and its sidecar files in Git. Choose an absolute runtime path or resolve the path from the deployment root so every start opens the same file.
Store configuration by workspace ID and channel ID. Add a unique key if you record processed event IDs. Test by saving a preference, restarting, and asking the bot to read the same preference back. Check the directory in Files and include it in planned backups.
Use PostgreSQL when multiple services need the state
For a Bolt worker, a browser dashboard and a separate scheduled job that share settings, start with a network database. Connect to a managed PostgreSQL deployment using its displayed connection settings. The database consumes its own allocation and deployment slot within the account pool. Store its connection string in each consumer’s Variables.
Use transactions and unique constraints for changes that might run concurrently. Record install credentials only when your app actually handles workspace OAuth, and keep the installation store access limited to the service that needs it. Use separate development and production databases or credentials.
Check that the saved state is recoverable
For SQLite, use its backup API or take a consistent copy while the writer is stopped. Keep the database’s layout and migration steps alongside the source. For PostgreSQL, inspect the completed recovery points on the database deployment. Test a restore with a disposable copy and verify one known setting through the bot.
A code checkout can change what opens the database. Plan schema changes so a source rollback can still read the saved rows, or prepare a separate data recovery step. Review the file recovery guide before replacing a live database file.