HCode runs Redis 7, reachable from your app over the project's private network. It has scheduled backups, but not the SQL editor, imports or external access that PostgreSQL has.
Connect
The internal connection string on the database's card looks like this:
redis://default:dbp_xxxxxxxx@db-0a1b2c3d4e5f:6379/0
The user is always default and the password is generated for you. The string selects database 0, and that is the database HCode backs up. Put it in an environment variable such as REDIS_URL and redeploy or restart your app. See Environment variables.
Memory and persistence
A Redis database reserves 64 MB of memory and can use up to 128 MB. It also reserves 5 GB of storage for its data on disk.
Redis runs with append-only persistence turned on, so writes are saved to disk and survive a restart. HCode does not set maxmemory or an eviction policy. If you use Redis as a cache, give keys an expiry so the data set stays inside the memory limit.
Backups
Redis databases are backed up on the same schedule as PostgreSQL ones. See Scheduled backups.
Two things are different:
- A backup covers database 0 only. The dashboard says "Covers database 0, the one your connection string selects. Keys in other Redis databases (SELECT 1–15) are not backed up."
- A backup is not a single point-in-time snapshot. HCode copies the keys one by one, so a key written while the backup runs may or may not be in it, and keys that expire during the backup are left out.
Restoring a backup replaces the data with what the backup holds. Because only database 0 is backed up, keys you kept in other Redis databases are not brought back. See Restore a backup.
Not available for Redis
- External access and access tokens. The card says "External access and token-based access for Redis are not available yet."
- Imports. Starting one through the API is refused with "imports for redis databases are not available yet".
- The SQL editor and table browser. Redis databases have no Browse or Import button.