Redis Feature Store Demo (PHP)
Predis + PHP built-in server

Redis Feature Store Demo

A small fraud-scoring feature store. Each user is one Redis hash at __KEY_PREFIX__{id} with a batch-materialized batch half (daily aggregates, 24-hour key-level EXPIRE) and a streaming streaming half (real-time signals, __STREAM_TTL__s per-field HEXPIRE). Inference reads any subset with one HMGET; batch scoring pipelines HMGET across N users.

Store state

Loading...

Materialize batch features

Calls HSET + EXPIRE for each user through one Predis pipeline — the whole batch ships in one round trip.

Drop the TTL to e.g. 30 s and watch entities disappear on schedule — the same thing that happens if a daily refresher fails.

Streaming worker

Picks __USERS_PER_TICK__ users per tick, writes the streaming features, applies HEXPIRE __STREAM_TTL__s per field. Pause it and the streaming fields drop out via per-field TTL while the batch fields stay populated.

Inference read (HMGET)

Pick a user and a feature subset. One HMGET round trip returns whatever the model needs.

Feature subset

Tick to include in the HMGET. Per-field TTL is shown next to each field in the result table.

Pick a user and click Read features.

Batch scoring

Pipelined HMGET across N random users via Predis pipelines. One network round trip for the whole batch.

(no batch read yet)

Inspect one user

HGETALL plus per-field HTTL and key-level TTL. Useful for spotting which streaming fields have already expired.

(pick a user and click Inspect)

RATE THIS PAGE
Back to top ↑