rewrite(scaling): cost-per-user as a design constraint#2
Conversation
Reframe the post around deliberate architecture for a flat cost-per-user curve, not a before/after cleanup. Drops the "naive vs deployed" delta tables in favor of "what this design actually costs to operate" + projected user-count headroom. Adds auth.deutschmark.online as the platform's centralized session worker (per-product workers don't reimplement OAuth) and the T(N) = $6 + $0.03·N cost model wired to the /support funding target. New title; updated index entry to match.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08608301be
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| | 10 | ~500 | ~2,000 | 99.93% | | ||
| | 100 | ~5,000 | ~20,000 | 99.34% | | ||
| | 1,000 | ~50,000 | ~200,000 | 93% | | ||
| | 10,000 | ~500,000 | ~2M | 34% | |
There was a problem hiding this comment.
Fix 10k-user headroom sign in cost table
Section 4.1 states the Workers Paid plan includes 10M Worker requests/month and 10M KV reads/month, but the 10,000-user row here is ~2M requests/day and ~500k KV reads/day (about 60M and 15M per month), which is already beyond those monthly included allotments. Labeling this as 34% headroom misstates capacity and can lead to materially wrong budgeting decisions; this row should indicate overage (or negative headroom), not remaining headroom.
Useful? React with 👍 / 👎.
| - 1 read per overlay refetch triggered by a config-changed broadcast (rare; dashboard-driven) | ||
|
|
||
| The same logic does not transfer cleanly to WebSocket clients: they don't poll when hidden, but they do reconnect on transient network errors. A flapping WebSocket with exponential backoff topping at 30 s on a hidden tab costs ~2,880 KV reads/day per overlay if each reconnect resolves `wid → twitchId` against KV. The mitigation is in §4. | ||
| That sums to ~50 KV reads per user per session for the typical case, with the long tail driven by event volume (chat commands, EventSub callbacks). Worker requests follow the same shape — a handful per session, scaling with events rather than polls. |
There was a problem hiding this comment.
Reconcile per-session KV sum with its breakdown
The five bullets in §4.2 enumerate roughly 1 + K(~8) + 5 + couple + rare KV reads, but this sentence says they “sum to ~50 KV reads” for a typical session. Because the explicit arithmetic in the listed components does not reach 50, the model is not reproducible and the projection in §4.3 becomes ambiguous; add the missing event-volume term to the breakdown or adjust the stated total.
Useful? React with 👍 / 👎.
Summary
scaling-streaming-toolsets/README.mdaround the framing "designed for the cliff from the start" instead of "naive vs deployed" delta tablesauth.deutschmark.onlineas the platform's centralized session worker — per-product workers don't reimplement OAuth, the SSO cookie is scoped to.deutschmark.online, new surfaces inherit auth by being on the right domain−99.7%deltas; added "what this design actually costs to operate" + projection to user count anchored at the chosen architectureT(N) = \$6 + \$0.03·Nmodel wired to the/supportcommunity-fund targetTest plan
auth.deutschmark.onlineis accurately characterized (SSO cookie, OAuth boundary)T(N) = \$6 + \$0.03·Ncost model matches the current snapshot