[REQUEST] Support Redis Cluster mode (AWS ElastiCache cluster-mode-enabled)

未關閉
#9,734 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
45/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
aws, node.js, redis, typescript
領域
backend, databases

研究方向

Start by locating the standalone ioredis client construction and the Redis pub/sub paths; the issue does not name their files, so search for REDIS_URL and the subscriber setup. Check how TLS settings reach the client and how live status handles subscriptions. Done means cluster mode can connect to Redis Cluster with TLS and key/value operations and live status both work; the issue leaves the configuration shape and pub/sub approach open.

由索引模型根據 Issue 內容生成。

描述

Is your feature request related to a problem? Please describe.

Self-hosted Sim cannot use a Redis Cluster, which rules out AWS ElastiCache in
cluster-mode-enabled (and ElastiCache Serverless, which requires a cluster-capable
client). The only managed option left is a cluster-mode-disabled replication group,
which caps scaling at a single primary.

The env surface is a single endpoint:

REDIS_URL:            z.string().url().optional()
REDIS_TLS_SERVERNAME: z.string().min(1).optional()

There is no cluster flag and no seed-node list, and Sim never constructs an ioredis
Cluster — a standalone client is built from that one URL. Pointing it at a
configuration endpoint connects to a single shard, so any key hashing to another
slot fails with MOVED.

Notably ioredis 5.11.1 is already bundled and exports Cluster, so the capability
is present in the dependency tree and simply isn't reachable through configuration.

Describe the solution you'd like

Let REDIS_URL (or an additional variable) drive an ioredis Cluster client when
cluster mode is requested. Something like:

  • REDIS_CLUSTER_MODE=true, or a comma-separated REDIS_CLUSTER_NODES, selecting
    new Redis.Cluster(nodes, opts) instead of new Redis(url)
  • the existing REDIS_TLS_SERVERNAME / rediss:// handling carried through to
    redisOptions, since in-transit encryption is the norm on ElastiCache

The pub/sub paths matter as much as the key/value ones here: cluster pub/sub needs
either sharded pub/sub (SSUBSCRIBE) or a node-aware subscriber, so a transparent
swap of the client constructor alone may not be sufficient for live status.

Describe alternatives you've considered

  • Cluster-mode-disabled replication group — what I'm doing now. Works, but it
    caps scaling at a single primary.
  • A cluster-aware proxy (Envoy Redis filter, twemproxy) — not viable. Envoy's
    Redis proxy does not support pub/sub, which is exactly what Sim needs Redis for.
    Caching would work while live status silently never streams.
  • Patching Sim to build a Cluster — possible since ioredis is already present,
    but that means maintaining a fork and rebuilding the image on every upgrade.

Additional context

Observed on ghcr.io/simstudioai/simstudio:latest (pulled 2026-11-06), ioredis
5.11.1, Docker Compose self-host.

Per the compose comments, Redis is optional for storage (Postgres is the fallback)
but the pub/sub channels have no fallback — so for anyone wanting live status on a
managed Redis, the cluster-mode constraint decides the architecture. Happy to test
a patch against ElastiCache if that's useful.

主要語言
TypeScript
星號
29.8k
分支
3.9k
平均合併
1 小時 44 分鐘
30 天內合併 PR
841

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

simstudioai/sim 的其他 Issue

查看 simstudioai/sim 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。