Redis

Databases

Databases in Redis are a form of namespacing, but they are still persisted in the same file. Redis database can be simplily specified by zero-based numeric index.

NOTE

Default deployment of Redis, the maximum number of database is 16.

For given database number of n, AFFiNE will take use of [n...n+4] for different purpose. You can set the default database used by REDIS_SERVER_DATABASE environment variable.

Use standalone Redis

If you want to replace the integrated Redis with standalone Redis instance, replace the REDIS_SERVER_* environment variables.

.env
REDIS_SERVER_HOST=<ip-or-host>
REDIS_SERVER_PORT=6379
REDIS_SERVER_USER=
REDIS_SERVER_PASSWORD=
REDIS_SERVER_DATABASE=
compose.yml
services:
  # ...
  affine:
    environment:
      REDIS_SERVER_HOST: ... 
  affine_migration:
    environment:
      REDIS_SERVER_HOST: ... 
  redis: 
    # ...