Пишите Redis-команды, запускайте их на детерминированном keyspace и проверяйте TTL, contention, cursor и стоимость операций.
● ENGINE READYRedis-compatible training enginedeterministic · in-memory · no network
CASE / HASH / TTL / STATE EXTERNALIZATION
Session state outside the pod
API pods must stay stateless. Create session s-2048 for tenant 42 and user 8421 as a hash, give the whole session a 30-minute lifetime, then read back both data and TTL.
FIXTURE
empty keyspace
TIMEBOX
18 min
TARGET
Redis 7+
01 / CONTRACT
Какой инвариант нужен
Encode an opaque session key, field-addressable state and expiry as one explicit storage contract.
One hash per session
A hash updates individual fields without serializing the whole object. The opaque session id belongs in the key; credentials and raw bearer tokens do not belong in the value. Any API replica can now serve the request without sticky routing.
TTL is part of the write path
Redis keys are persistent by default. EXPIRE turns cleanup into a storage invariant; a sliding session refreshes that TTL on accepted activity. Persistence policy still decides how much session loss a restart may cause.
COMMAND SURFACEBOUNDED ENGINE
HSET · EXPIRE · HGETALL · TTL
02 / COMMANDS
redis-cli transcript
Инициализация command editor…
LOCAL SIMULATOR24 commands · 4 KB · isolated fixture
RESP / STATE / COST
Запустите command file. Simulator каждый раз начинает с канонического fixture и не меняет браузерное или серверное состояние проекта.