Live Edit backing store#

Live Edit stores all session and layer state in Valkey. The store is the source of truth, not a cache: every replica reads and writes the same store, and losing it loses live edits that are not in a checkpoint. This page lists what the store must provide, how Live Edit connects and authenticates to it, and how to size it. Read it before Deployment, then follow the page for your platform:

You run the store…

Follow

yourself, in your Kubernetes cluster

Self-hosted Valkey

on Azure

Azure Managed Redis

on AWS

Amazon MemoryDB or ElastiCache

Requirements#

Every store must meet all of these:

  • Engine: Valkey 7.2 or newer, or Redis OSS 7.x on a compatible managed service.

  • One deployment per keyspace: give each Live Edit deployment its own store or keyspace; all of its replicas use the same one.

  • No eviction: set maxmemory-policy noeviction. A full store then refuses uploads with the retryable UNAVAILABLE and applies nothing, instead of silently deleting committed layer data. On managed platforms this is a create-time choice.

  • A memory limit: on a store you run yourself, set maxmemory below the container or host memory limit.

  • Connection limit: the store must accept connections from twice your maximum replica count (see Connections).

  • Cluster mode: a clustered store must keep each multi-key operation’s keys in one hash slot. Live Edit’s keys carry hash tags that guarantee this, so no key or application change is needed; connect with the cluster URL scheme.

  • Script reads: a Lua script must be allowed to read keys it did not declare, in its declared key’s hash slot. Standard Valkey and Redis, Azure Managed Redis and Amazon MemoryDB allow it. Each replica checks this at startup (see Startup check).

  • Pub/sub: allow PUBLISH inside Lua scripts, and on a cluster deliver every published message to subscribers on every node, in publish order. Session presence depends on it.

  • Clocks: keep cluster nodes’ clocks synchronized (NTP or the provider’s equivalent), within 15 seconds of each other.

  • TLS: use TLS for any non-loopback connection. The server certificate must chain to a public root, or you must mount a CA bundle holding your private CA and the public roots into the Live Edit container (see TLS).

  • Network: let service pods reach every node and port a cluster advertises, not only its bootstrap endpoint.

  • Access control: grant the service’s user +@all commands on the le: keyspace and channels, for example the ACL on ~le:* &le:* +@all. Restrict keys and channels, never commands: removing commands breaks cluster discovery and rarely used paths.

  • Durability: configure store persistence, checkpoints, or both, as Durability describes. Live Edit refuses to start when it can confirm that both are off.

Startup check#

Before it reports ready, each replica runs one script that reads an undeclared key in its declared key’s slot.

  • If the store refuses that read, the replica logs an error naming this requirement and exits. Use a store that allows it; there is no workaround.

  • If the store refuses the script itself, the replica exits with an error naming the script and the store’s error. Check the ACL.

  • If the store cannot answer (loading, busy, cluster down, or no reply within valkey.commandTimeoutMs), the replica logs a warning and starts anyway. The check is not repeated, so if the warning appears, confirm the store meets the requirement.

Connection URL#

Choose the scheme for the topology the endpoint presents:

Endpoint

URL form

Single primary, TLS

rediss://{USER}:{PASSWORD}@{HOST}:{PORT}

Cluster, TLS (Azure Managed Redis, MemoryDB, ElastiCache, self-hosted cluster)

rediss-cluster://{USER}:{PASSWORD}@{HOST}:{PORT}

A single-primary URL against a multi-shard cluster fails on cross-shard keys. Use redis:// or redis-cluster:// only for a local store without TLS. URL-encode reserved characters in credentials.

A URL that carries a credential goes in the live-edit-env Secret under key valkey-url, as Deployment shows. A URL without one (the passwordless modes below) can be set inline:

valkey:
  url:
    value: "rediss-cluster://{HOST}:{PORT}"

valkey.url.valueFrom takes any Kubernetes environment source, such as a ConfigMap key, instead.

Authentication#

Enable at most one of valkey.credentials.static, accessTokenFile or awsIam; the chart refuses to render with more than one. With none enabled, Live Edit uses the credentials in the URL. Prefer a passwordless mode in production: it removes the long-lived secret.

Mode

Use with

Credential

static (default)

self-hosted Valkey, development, access keys

user and password in the URL

accessTokenFile

Azure Managed Redis with Microsoft Entra ID, or any store that accepts a renewable bearer token

token written to a file by your token provisioner

awsIam

Amazon MemoryDB, ElastiCache for Valkey

AWS IAM token generated by the service from the pod’s role

Password or ACL credentials#

Put the full URL, with user and password, in the live-edit-env Secret. Changing the Secret does not restart pods: roll the deployment after rotating the credential.

Access-token file#

valkey:
  url:
    value: "rediss-cluster://{HOST}:{PORT}"
  credentials:
    accessTokenFile:
      enabled: true
      username: "{PRINCIPAL_ID}"
      path: /etc/secrets/access-token/valkey_access_token

Your token provisioner writes the token to path, with the audience the store accepts, in the token file format. This mode requires serviceIdentity.accessTokenFile.enabled: true; the chart refuses to render without it. On Azure Managed Redis, replace the token as Token refresh says.

AWS IAM#

valkey:
  url:
    value: "rediss-cluster://{CLUSTER_ENDPOINT}:6379"
  credentials:
    awsIam:
      enabled: true
      service: memorydb          # or elasticache
      username: "{ACL_USER}"
      region: "{AWS_REGION}"
      clusterHost: "{CLUSTER_NAME}"

clusterHost is the cluster or cache name, not its endpoint hostname; with the hostname, authentication fails. The pod gets its AWS credentials from its ServiceAccount’s IAM role (serviceAccount.annotations."eks.amazonaws.com/role-arn"). The AWS page creates the user and role.

Sizing#

Size memory first, then per-shard CPU, then check connections. The platform pages give starting sizes.

Memory#

Memory grows with the number of layers being edited at once, not with sessions or users. For each such layer, plan for:

  • Layer state: about 1.2 MB for a layer of 10,000 fields; about 12 MB for 100,000 fields.

  • Recent updates: the layer keeps its last 4,096 updates: a few MiB for small edits, and up to about 154 MiB for large updates at the default valkey.layerStreamMaxBytes (128 MiB). Read your mean update size from live_edit_update_layer_relay_bytes.

  • Large values (meshes, textures and other external values): stored once per distinct content, plus replaced values and the values of deleted layers awaiting clean-up, usually for seconds; a burst of very large deletions holds them longer.

To save memory, lower valkey.layerStreamMaxBytes before buying more. Keep a busy layer’s update bytes per checkpoint interval well inside it, or incremental backups lose coverage (Durability).

Headroom: give the store about twice your expected peak memory. With noeviction, a full store refuses writes. A store filled by large values awaiting clean-up recovers by itself within seconds; a store full of layer data stays full until you add memory or, on self-hosted Valkey or Azure Managed Redis, until clients delete layers. Live Edit can write a few MB past maxmemory while the store is full, so keep maxmemory at least a few MB below the container or host memory limit, or the server can be killed for running out of memory.

Memory settings: self-hosted Valkey, MemoryDB and ElastiCache report their memory limit to Live Edit, so leave valkey.memoryBytes unset on them. Azure Managed Redis does not: set valkey.memoryBytes to the cache’s total memory, as its size section shows.

Is it filling up? Watch live_edit_store_memory_used_ratio; Store memory gives the levels at which to grow the store and how to alert on it.

CPU#

If a shard’s CPU stays near one full core, add shards; a larger node does not help. One very busy layer always stays on one shard.

Connections#

A rollout briefly doubles the replica count, so the store must accept connections from twice autoscaling.maxReplicas replicas. At the chart defaults:

Store

What to do

Self-hosted Valkey, standalone or cluster

set maxclients 12000, as the self-hosted page does

Azure Managed Redis Balanced_B0 to Balanced_B5

keep autoscaling.maxReplicas at 9 or fewer

Azure Managed Redis Balanced_B10 and larger, MemoryDB, ElastiCache for Valkey

nothing

If the store runs out of connections, new pods cannot connect, the rollout stalls, and some subscriptions fail until it ends. The table includes one running disaster-recovery Job.

If you change a connection pool, recheck the limit with these most-connections figures:

Connections

Single-primary store

One cluster node

Whole cluster, 3 primaries

One replica, chart defaults

392

528

800

One disaster-recovery Job, chart defaults

136

272

544

Each step up in valkey.poolSize

+2

+4

+8

Each step up in valkey.maintenancePoolSize, valkey.snapshotPoolSize, or, while snapshotPoolSize is unset, valkey.catchupSnapshotReadConcurrency or valkey.catchupFencedReadConcurrency

+1

+2

+4

Each step up in valkey.subscriberPoolSize (replicas only)

+1

+1

+1

With more than three primaries (count the master lines CLUSTER NODES returns), add 136 per further primary to each whole-cluster default, and per step 2 more for valkey.poolSize and 1 more for the maintenance and snapshot pools.

Keep twice autoscaling.maxReplicas replicas plus one Job within each node’s limit: maxclients, or 65,000 on MemoryDB and ElastiCache. On a self-hosted cluster, also leave room in maxclients for 2 connections per other node. An Azure Managed Redis limit covers the whole cache: 15,000 on Balanced_B0 to Balanced_B5, 30,000 on Balanced_B10 and 75,000 on Balanced_B20.

When the store moves data between shards#

A clustered store moves data between shards when you add or remove shards, and a managed store does so when it scales or rebalances. How Live Edit is affected depends on how the store moves it:

  • Key-by-key moves (the classic reshard) refuse writes to the layers and sessions in each moving slot, with the retryable UNAVAILABLE, until that slot’s move ends, so a slow move means long refusals. Catch-ups and backups of those layers fail and are retried, so expect backups to lag during the move.

  • Atomic slot migration (Valkey 9.0 or later) keeps serving the moving slots and pauses writes only briefly at each cutover.

Clients retry the refusals; other layers and sessions are unaffected. Live subscriptions to a moving layer pause until its move ends. If a session’s move lasts longer than about a minute, other participants can see a member leave and rejoin.

During a move expect live_endpoint_calls_total{grpc_code="UNAVAILABLE"} to rise for the affected calls, a few live_edit_valkey_reconnects_total, and, in long moves, live_edit_presence_lease_refresh_failures_total and live_edit_presence_rejoins_total. They stop when the move ends.

During a move, the backup gauges live_edit_checkpoint_oldest_pending_age_seconds, live_edit_checkpoint_layers_never_written and live_edit_checkpoint_ext_backup_owed can hold their last value. Background passes log WARN lines about the move, containing migrating or importing or end-of-walk routing-table refresh failed. Backups continue meanwhile; once the move ends, the gauges update again and the WARN lines stop.

A restore or accept-loss Job that reads the store during a move can stop with exit code 1 and be retried (Read a Job’s log); start one only after the move ends. On a self-hosted cluster, move slots as Adding shards describes.

What to watch#

Signal

Act when

live_edit_store_memory_used_ratio

as Store memory says

live_edit_store_write_refused_total{reason="out_of_memory"}

any increase: the store is full; add memory, even if the refusals stop by themselves

live_edit_gc_oom_collections_total{outcome="refused"}

any increase: the service cannot free memory on this store while it is full; add memory

live_edit_ext_release_pending_bytes against live_edit_ext_release_budget_bytes

pending nears the budget: clean-up is falling behind, and uploads carrying large values start to wait

live_edit_valkey_errors_total

a sustained rate: connection, authentication or timeout faults

live_edit_valkey_consumer_permanent_exits_total

above zero: a credential or endpoint problem

Alert rules are on Monitoring; metric details are on Metrics reference.

See next#

Set up the store on your platform: self-hosted, Azure or AWS.