Negative caching bounds the missing-key stampede
Target design: repeated lookups of a nonexistent alias cache a short-lived negative result so attackers or hot dead links cannot bypass the cache to the database.
Service case study
A redirect service engineered around its hot path: PostgreSQL storage, Redis cache-aside with bounded fallback, per-instance singleflight and reproducible latency benchmarks.
PlannedBackend runtime: No deployed runtime — specification stageDemo data source: Mock
Redis cache-aside, singleflight, hot path, bounded analytics.
Backend implementation is not present yet. The demo module renders the planned flows with deterministic mock data; the content below is the proposed boundary, not a shipped system.
No backend implementation exists yet: the demo renders deterministic MSW scenarios of link management and analytics.
docs/backend-specs/04_url_shortener.mdzolotoy-dev-frontend (this repository)reviewed 2026-09-17A redirect hot path that serves from Redis cache-aside, falls back to PostgreSQL with bounded concurrency, and returns 404/410 according to link state.
docs/backend-specs/04_url_shortener.mdzolotoy-dev-frontend (this repository)reviewed 2026-09-17Cache invalidation on link mutation, negative caching for missing keys, and TTL bounds that cap staleness after invalidation races.
docs/backend-specs/04_url_shortener.mdzolotoy-dev-frontend (this repository)reviewed 2026-09-17Per-instance singleflight collapses concurrent misses for the same key into one database read; it does not coordinate across service instances.
docs/backend-specs/04_url_shortener.mdzolotoy-dev-frontend (this repository)reviewed 2026-09-17Reproducible latency/throughput benchmarks with published methodology — a measurement, not a marketing number.
docs/backend-specs/04_url_shortener.mdzolotoy-dev-frontend (this repository)reviewed 2026-09-17docs/roadmap.mdzolotoy-dev-backende36b1025reviewed 2026-09-17Target design: repeated lookups of a nonexistent alias cache a short-lived negative result so attackers or hot dead links cannot bypass the cache to the database.
Target design: in-flight request coalescing removes same-instance duplicate misses. Cross-instance coordination would add a distributed lock to a hot path — rejected; bounded fallback concurrency does that job instead.
Target design: click counts are incremented asynchronously and may lose data under failure; correctness of the redirect never depends on analytics.
docs/backend-specs/04_url_shortener.mdzolotoy-dev-frontend (this repository)reviewed 2026-09-17docs/roadmap.mdzolotoy-dev-backende36b1025reviewed 2026-09-17Database/redirect hot path, Redis fallback, per-instance singleflight, reproducible measurements and bounded analytics.
Acceptance evidence (planned):