Core dataAnalytics

Real-Time Analytics

Count events as they happen, rank what is trending, and see which keys carry the load.

per event
O(1)
trending lists
Live
Prometheus metrics
Built-in
Step 1 of 4
Count every view

One counter per day. Each event is a single in-memory increment.

Example sessionplaying
# Count every view
hotkv> INCR pageviews:2026-10-16
(integer) 184213

An animated walkthrough with real HotKV commands and example replies. Click any step to jump to it.

The problem

Dashboards that lag by minutes are not real time. Writing every page view to a database and aggregating later is expensive, and when one key suddenly takes most of the traffic, you often find out only after a node falls over.

How HotKV handles it

Counters and sorted sets absorb a constant stream of events cheaply, and the totals are readable at any moment. Hot key detection shows which keys are hit hardest, and the engine's own metrics are exported in Prometheus format.

Step by step

What happens, command by command

  1. 01

    Count every view

    One counter per day. Each event is a single in-memory increment.

    INCR pageviews:2026-10-16
  2. 02

    Rank what is trending

    Sorted sets keep articles in order as views arrive.

    ZINCRBY trending:articles 1 article:42
  3. 03

    Read the top 10

    The dashboard refreshes every second.

    ZREVRANGE trending:articles 0 9 WITHSCORES
  4. 04

    Find the hot keys

    With hotkey-tracking enabled, the most accessed keys are listed without scanning.

    HOTKEYS TOP 3
Where it fits

Real-world scenarios

Media and publishing

Newsrooms watch which stories are rising minute by minute and promote them on the homepage.

Product analytics

Feature usage counters per day feed live dashboards without an event warehouse in the hot path.

Operations

Hot key detection points at the key behind a sudden CPU spike before it takes a node down.

Built in

What you get

Cheap counters

INCR per event, per bucket.

INCRINCRBY

Trending lists

Sorted sets ordered as events arrive.

ZINCRBYZREVRANGE

Hot key detection

The most accessed keys, approximate, without scanning.

HOTKEYS TOP

Prometheus metrics

The engine's own metrics on a metrics port.

Common questions

How do I count per minute or per day?

Put the bucket in the key name, such as pageviews:2026-10-16, and add an expiry so old buckets clean up.

How do I count unique visitors?

Use HyperLogLog with PFADD and PFCOUNT. See the probabilistic counting use case.

Can I monitor HotKV with Prometheus?

Yes. HotKV exposes built-in metrics in the Prometheus format.

Related use cases

Try it on your own workload

HotKV speaks the Redis protocol, so you can point an existing client at it and run these same commands.