api: share dashboard and list aggregates across replicas through a short Redis cache

Open
#2,359 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go, redis

Research direction

Start by reading test/load/BASELINE.md and tracing CountDagsByLatestRunState to find the dashboard aggregate query and its callers. Then inspect how the project separates Lite and Pro deployments and handles Redis and per-key request deduplication. Done means 50 concurrent dashboard pollers trigger at most one aggregate query per key per TTL, responses are no more than TTL seconds stale, database failures remain usable, and individual run or task state is never cached.

Written by the indexing model from the issue text.

Description

area/api area/storage enhancement priority/p3

Why

CountDagsByLatestRunState costs 453 ms on the 1M run data set (test/load/BASELINE.md), and every open UI tab repeats it on the auto refresh interval, on the same primary the scheduler uses. This is the cache half of #2331.

What

  • Cache dashboard aggregates per tenant and per filter in Redis with a TTL of a few seconds, below the UI refresh interval.
  • singleflight per replica, so a burst of tabs costs one query per key per replica at most, and one per key cluster wide while the value is fresh.
  • Fail open to the database; Lite uses an in-process TTL cache with the same interface.
  • Never cache anything a user acts on (the state of a single run or task).

Done when

With 50 concurrent dashboard pollers the primary sees at most one aggregate query per key per TTL, and responses are at most TTL seconds stale.


Generated by Claude Code

Dominant language
Go
Stars
46
Forks
1
Avg merge
10h 26m
Merged PRs (30d)
606

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dexadata/dexaflow

All issues in dexadata/dexaflow

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.