FFORGE//RS
← Roadmap

distributed systems / LEVEL 3

The session key nobody could expire

EST.40 MIN
01

THEORY / RETRIEVAL

What to restore

  • Create namespaced keys with an explicit TTL contract
  • Use a cluster hash tag only for keys that require co-location
  • Reject identifiers that can escape the key schema

Redis is a data structure server, not a dumping ground

Every key family needs an owner, cardinality estimate, value-size bound, TTL or retention rule and failure semantics. Session state should expire independently of application cleanup, while durable business truth usually belongs in a database designed for recovery and audit.

Key shape controls operability and placement

Namespaces make ownership visible. In Redis Cluster, the substring inside braces is a hash tag that co-locates related keys, enabling multi-key operations but also concentrating load. Production discovery uses cursor-based SCAN rather than blocking the server with a broad KEYS query.

CHECKPOINT

What is the most important protection against abandoned login sessions accumulating forever?

ISOLATED RUST 1.96
src/lib.rsEDIT

02 / IMPLEMENTATION

Implement the contract

Build the two session keys. Tenant and session ids must be 1..=64 ASCII letters, digits, dash or underscore. TTL must be from 60 seconds through 30 days. Both keys need the same Redis Cluster hash tag and no user-controlled separators.

Initializing editor…
CLOUD SANDBOXnetwork off · 256 MB · 12 s
1 / 64 KB
OUTPUT
Runner is waiting for a submission.