Skip to content

docs(architecture): design for durable multi-instance approuter static serving - #1642

Merged
jung-thomas merged 1 commit into
mainfrom
worktree-approuter-static-design
Aug 11, 2026
Merged

docs(architecture): design for durable multi-instance approuter static serving#1642
jung-thomas merged 1 commit into
mainfrom
worktree-approuter-static-design

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Design proposal — durable multi-instance approuter static serving

Follow-up to the 2026-08-10/11 stale-static incident (root cause fixed in #1628; runtime-push guard added in #1641). This PR is a design doc only (no code) for the deeper architectural gap you asked to address.

The gap

POST /admin/rebuild (approuter/server.js:373-374) atomically swaps the local static/ on only the one instance the CF router hits, and the push is ephemeral — a cf restart re-extracts the droplet and discards it. So with instances > 1 (autoscaler), the fleet serves a mix of old/new static until the next full deploy, and autoscaled-up instances start from the (possibly stale) droplet. Key finding: "restart after rebuild" is a recovery tool, not a propagation mechanism.

Options (full detail in the doc)

  • A — instance-targeted fan-out (X-Cf-App-Instance): interim, contained; doesn't survive restart/scale-up.
  • B — CAP/HANA-backed versioned bundle + approuter self-sync (recommended): durable + convergent; reuses existing HANA + srv-api binding + /ws/*; no new entitlement.
  • C — BTP Object Store: like B but needs an entitlement/binding; prefer only if the bundle is too big for HANA.
  • D — eliminate runtime push: rejected (kills the fast-rebuild cadence).

Recommendation

Phased: Phase 0 done (#1628 + #1641) → Phase 1 optional fan-out → Phase 2 Option B.

Open questions for you

  1. Static bundle size → decides B (HANA) vs C (object store).
  2. Worth doing Phase 1 (fan-out) or go straight to Phase 2?
  3. Version signal: poll vs. reuse the /ws/* WebSocket?

Once you pick a direction I'll turn it into an implementation plan + PR. Draft for review.

…c serving

POST /admin/rebuild mutates only the one approuter instance the CF router
hits, and the push is ephemeral (a restart reverts to droplet static). With
instances>1 (autoscaler) the fleet serves a mix of old/new static until the
next full deploy. This design doc frames the problem, constraints (no object
store; approuter binds srv-api + HANA + WS already exist), and options:
A) instance-targeted fan-out (interim), B) CAP/HANA-backed versioned bundle +
approuter self-sync (recommended), C) object store (needs entitlement),
D) eliminate runtime push (rejected). Recommends B, phased. For review.
@jung-thomas
jung-thomas marked this pull request as ready for review August 11, 2026 11:18
@jung-thomas
jung-thomas merged commit b1f18b8 into main Aug 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant