---
title: Redis
scope: 3dmk
type: documentation
subject: redis
group: Systems
status: current
version: "2.1.3"
source: https://3dmk.com/documentation#redis
author: Nick Olson
contact:
  email: 3dmk@3dmk.com
  site: https://3dmk.com
license: CC BY 4.0
license_url: https://creativecommons.org/licenses/by/4.0/
attribution: Nick Olson, 3dmk.com
---

# Redis

Redis is the shared cache for the stack, an off-the-shelf data store that keeps its data in memory. Core runs it, and projects only consume it. Redis holds information that changes too fast to fetch from the main database each time. Durable records stay in Postgres, and secrets stay in Vault.

## Role

Redis is the only cache in the stack. No project deploys its own cache or another caching technology. Services use Redis for caches, short-lived infrastructure snapshots, counters, queues, and live dashboard data. Every cached value is disposable, so a service must still work when the cache is empty.

## Parts

Redis has three parts:

- Development container: One Redis container runs on `core-docker-1`. The Core bootstrap starts it with settings from Consul and a password from Vault.

- Production container: A matching container runs on `core-docker-aws-1` under the same name. Publishing holds its configuration.

- Client libraries: Shared Core libraries for Python and Rust each provide a Redis client. Python services must use it. They never manage a connection inline.

## Data

Redis holds keys and values in memory. Each key starts with the owning service’s catalog name, then a domain, then the key itself: `<service-id>:<domain>:<key>`. Snapshot entries carry an expiry time. NervHQ’s infrastructure snapshots expire after 300 seconds, so stale entries clear when a collector stops reporting. Publishing’s cached health results expire after 120 seconds.

Neither host writes Redis data to disk. A restart empties Redis, and services rebuild what they cache. A full Redis refuses new writes with an error. It never drops keys silently.

## Connections

Redis exchanges settings, credentials, and cached data with the systems in this table.

| System | What passes |
|---|---|
| Consul | Services find Redis by name. The bootstrap reads the Redis settings from Consul. |
| Vault | Vault holds the Redis password. |
| Postgres | Postgres keeps the durable copy. NervHQ reloads its cache tables from Postgres after a restart. |
| NervHQ | The API caches dashboard data and infrastructure snapshots. Database writes update Redis, and WebSocket events refresh the dashboard. |
| Publishing | Publishing keeps its deploy queue and cached health results in Redis. |
| Game services | Game APIs keep limit counters and other short-lived state in Redis. |
