Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(cdp): give the hobby and dev-full stacks a valkey to dual-write to (#78867)

Ben Whitea110a704caf8
diff --git a/docker-compose.base.yml b/docker-compose.base.yml
index 3171533c4c50..483fc3a37a8f 100644
--- a/docker-compose.base.yml
+++ b/docker-compose.base.yml
@@ -176,6 +176,20 @@ services:
timeout: 10s
retries: 10
+ # Shadow store the CDP services dual-write to alongside redis7. Plain mode, unlike the
+ # dev stack's cluster-enabled valkey-cluster: reproducing the CROSSSLOT rejection of a
+ # cluster only earns its complexity where CDP changes get tested. Mirror data is
+ # disposable, so there's no volume and eviction under the cap is fine.
+ valkey:
+ image: valkey/valkey:8.1-alpine
+ restart: on-failure
+ command: valkey-server --maxmemory-policy allkeys-lru --maxmemory 200mb
+ healthcheck:
+ test: ['CMD', 'valkey-cli', 'ping']
+ interval: 3s
+ timeout: 10s
+ retries: 10
+
clickhouse:
image: ${CLICKHOUSE_SERVER_IMAGE:-clickhouse/clickhouse-server:26.6.2.158}
restart: on-failure
diff --git a/docker-compose.dev-full.yml b/docker-compose.dev-full.yml
index 33113d333461..74f57ff8d859 100644
--- a/docker-compose.dev-full.yml
+++ b/docker-compose.dev-full.yml
@@ -37,6 +37,11 @@ services:
ports:
- '6379:6379'
+ valkey:
+ extends:
+ file: docker-compose.base.yml
+ service: valkey
+
clickhouse:
extends:
file: docker-compose.base.yml
@@ -192,9 +197,13 @@ services:
- .:/app/posthog
environment:
- DOCKER=1
+ # Every CDP process dual-writes to Valkey and refuses to start without a host.
+ - CDP_VALKEY_HOST=valkey
+ - CDP_VALKEY_PORT=6379
depends_on:
- db
- redis7
+ - valkey
- clickhouse
- kafka
- objectstorage
diff --git a/docker-compose.hobby.yml b/docker-compose.hobby.yml
index 443b5033d27a..ca9dfcba88b7 100644
--- a/docker-compose.hobby.yml
+++ b/docker-compose.hobby.yml
@@ -32,6 +32,12 @@ services:
volumes:
- redis7-data:/data
+ valkey:
+ extends:
+ file: docker-compose.base.yml
+ service: valkey
+ logging: *default-logging
+
clickhouse:
extends:
file: docker-compose.base.yml
@@ -199,6 +205,9 @@ services:
OBJECT_STORAGE_ENABLED: true
CDP_REDIS_HOST: redis7
CDP_REDIS_PORT: 6379
+ # Every CDP process dual-writes to Valkey and refuses to start without a host.
+ CDP_VALKEY_HOST: valkey
+ CDP_VALKEY_PORT: 6379
ENCRYPTION_SALT_KEYS: $ENCRYPTION_SALT_KEYS
CYCLOTRON_DATABASE_URL: 'postgres://posthog:posthog@db:5432/posthog'
PERSONS_DATABASE_URL: 'postgres://posthog:posthog@db:5432/posthog'
@@ -209,6 +218,7 @@ services:
depends_on:
- db
- redis7
+ - valkey
- clickhouse
- kafka
- objectstorage