Skip to content

Port follow-up: migrate every worker into the new BFF/service architecture; BFF scalability #1610

Description

@Xore

Follow-up to #1608 (per Xore). After the frontend/BFF/Rust-service port reaches parity:

Worker migration

Port every worker into the new architecture — inventory includes the dashboard's background loops (webhook alerts notifyLoop, scheduled PDFs reportScheduleLoop), es-results-importer, attacker-identity-worker, agent-intrusion-worker, and the payload/yara pipeline hooks. For each worker the target tier is chosen by the same serving-quality decision matrix used on #1608:

  • Rust service tier for CPU/IO-heavy correlation, importing, scanning-adjacent work;
  • BFF (Node) tier where the work is session/UI-adjacent (notifications surfaced to operators, report orchestration).

Each migration ships with parity tests against the current worker's observable outputs before the old one retires.

BFF scalability (hard requirement)

The BFF must scale properly and never get overwhelmed — it carries no compose resource limit:

  • Node cluster mode / worker_threads for CPU-bound composition; the event loop stays free
  • Backpressure end-to-end: bounded queues for fan-out to the Rust tier, 429/shed-load before collapse, per-route concurrency caps
  • Streaming responses (no buffering whole payloads), keep-alive pooling to the Rust service
  • Horizontal-ready: no in-process state that prevents running N BFF instances later (session in redis, prefetch cache shareable)
  • Load-test gate: sustained SSE fan-out + burst navigation without p99 regression

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions