Skip to content

KV: early-access-data blob has no TTL and grows unbounded #105

@davidcampbelldc

Description

@davidcampbelldc

Problem

The early-access-data KV key stores the entire waitlist CSV as a single blob. It grows with every signup and has:

  • No TTL — never expires
  • No size cap — KV values max at 25 MB, will silently fail at the limit
  • No cleanup — old entries are never pruned

Written by functions/api/early-access.js and functions/api/clean-csv.js, read by functions/api/early-access-csv.js.

Risk

Low velocity (signups are infrequent) but unbounded by design. If this ever becomes higher-volume, it'll hit the 25 MB KV value limit with no warning.

Fix Options

  1. Add a TTL (e.g., 90 days) — but this is the canonical store, losing it would be bad
  2. Move to D1 or R2 for structured storage (proper solution for growing data)
  3. At minimum, add a size check/warning log when the blob exceeds a threshold (e.g., 1 MB)

Files

  • functions/api/early-access.js (line ~764/787)
  • functions/api/clean-csv.js (line ~83)
  • functions/api/early-access-csv.js (read-only)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions