Choosing a Storage Backend
Bight’s storage facade needs an adapter to persist framework state (settings, plugin metadata, feature flags). The adapter you choose powers bight.storage. It does not replace your application database.
The CLI asks which adapter to use during scaffolding. You can also change it later by swapping the adapter in src/storage/adapter.ts.
Lightweight adapters
Section titled “Lightweight adapters”Best when you don’t need a managed database for framework state.
| Adapter | Best for | Backend |
|---|---|---|
| JSON | Local development, tiny bots | File on disk |
| Keyv | Lightweight production deployments | Redis, SQLite, Mongo, Postgres via Keyv |
ORM-backed adapters
Section titled “ORM-backed adapters”Best when your app already uses a database and you want Bight’s state to live alongside your tables.
| Adapter | Best for | Backend |
|---|---|---|
| Prisma | Apps already using Prisma | Any Prisma-supported DB |
| Drizzle | Apps already using Drizzle | PostgreSQL, MySQL, SQLite |
| Mongoose | Apps already using MongoDB | MongoDB |
When using an ORM-backed adapter, keep the storage facade for framework state only. Use your ORM client directly (through services) for application domain queries. See Settings & Data Strategy for details.