Sessions, Counters, and Rate Limits
Keep common application state beside each workload and share it when requests can reach several instances.
Store a serialized session with an expiration:
SET session:123 '{"user":42}' EX 3600
GET session:123
Use the same session key across workloads. Decide whether losing it should log the user out or require recovery from tiered storage.
Use INCR for a count instead of a client-side read followed by SET:
INCR views:article:42
Several workloads accessing the counter make it shared state. Measure that access pattern at the intended topology.
A fixed-window counter can use a key containing the window identifier, such as rate:user:42:2026-09-15T12:30.
Increment the key and compare the returned count with the limit. Expire old windows so they do not accumulate.
Coordinate multi-command updates with the supported transaction or scripting path, and test concurrent requests. Decide whether network failures should reject requests or permit them. Non-transactional counters accepting writes during a partition do not by themselves enforce a strict global admission limit.
Read transaction semantics and disconnected operation before relying on a cross-region limit.