Storage Systems
The Knot server supports multiple storage systems for managing data. Each storage option is designed to cater to different use cases and deployment requirements. Below is an overview of the supported storage systems:
1. MySQL / MariaDB
-
Description: Requires a MySQL or MariaDB server or a Galera cluster. Ideal for setups that need a robust, external database with advanced features like clustering and high availability.
-
Use Case: Suitable for production environments where scalability and reliability are critical.
2. PostgreSQL
-
Description: Requires a PostgreSQL server. Stores sessions as well as data, so users stay signed in when a server restarts without Redis / Valkey.
-
Use Case: Suitable for production environments that already run PostgreSQL, or want an external database without a separate session store.
3. BadgerDB
-
Description: An embedded database with no external dependencies. Data is stored locally, making it a simple and lightweight option that’s production-ready.
-
Use Case: Ideal for most deployments, including multi-server clusters where data is replicated between servers via gossip protocol. Perfect for teams wanting simplicity without external database infrastructure.
4. Redis / Valkey
-
Description: Requires a Redis or Valkey server or cluster. Can be used as the primary storage system or in combination with another storage system (e.g., MySQL). When used alongside another system, Redis / Valkey is utilized exclusively for session data, including with PostgreSQL.
-
Use Case: Ideal for setups requiring fast, in-memory data storage or session management. High availability and clustering options make it suitable for distributed environments.
Enabling More Than One Storage System
Only one storage system holds the data. If more than one is enabled, the server uses the first enabled in this order: MySQL / MariaDB, PostgreSQL, BadgerDB, Redis / Valkey. Redis / Valkey is the exception — when it’s enabled alongside another system it stores the sessions rather than being ignored.
Without Redis / Valkey, sessions are kept in PostgreSQL when it is the database, and otherwise in memory on each server, so restarting a BadgerDB or MySQL / MariaDB server signs its users out.
Each storage system offers unique benefits, allowing you to choose the one that best fits your deployment needs. For detailed configuration instructions, refer to the respective guides: