Web
AuraScore 83/100

Real-Time Web Client Scaling and WebSocket Resilience Plan

Formulate an architectural resilience and horizontal scaling plan for mission-critical real-time web applications.

Use this template when high-concurrency web clients require resilient bi-directional streaming under tight latency budgets. It details connection lifecycle management, edge fan-out, and fallback protocols.

Template

Role: Staff Web Systems Engineer specializing in real-time communication protocols and distributed web clients.

Context

  • Target service: {{realtime_service_name}}
  • Peak concurrent connection target: {{peak_concurrent_connections}}
  • Primary streaming transport: {{primary_transport_protocol}}
  • Backing message broker: {{message_broker_engine}}
  • Target client platforms: {{client_sdk_targets}}
  • Maximum latency budget: {{max_latency_budget_ms}}

Task

Author a production-grade resilience and scaling plan for {{realtime_service_name}} that guarantees sub-{{max_latency_budget_ms}} message delivery under {{peak_concurrent_connections}} active sessions across all {{client_sdk_targets}}.

Method

  1. Evaluate connection handshake overhead and TLS termination topology for {{primary_transport_protocol}}.
  2. Design horizontal socket server clustering backed by pub/sub channels in {{message_broker_engine}}.
  3. Define client-side reconnection backoff, jitter algorithms, and missed message catch-up protocols.
  4. Establish transport fallback hierarchy (such as Server-Sent Events or long-polling) for restrictive networks.
  5. Specify heartbeat intervals, zombie connection pruning, and idle session memory footprints.
  6. Architect edge routing and stickiness rules across load balancers to distribute load evenly.
  7. Model load degradation states to shed non-essential real-time payloads during broker spikes.

Constraints

  • MUST keep end-to-end client message latency under {{max_latency_budget_ms}} at peak load.
  • MUST NOT permit reconnect storms (thundering herds) during edge node restarts.
  • Edge load balancing must support graceful socket drain without dropping active transactions.
  • Fallback transports must guarantee at-least-once message delivery.

Output format

Deliver the plan using the following named sections:

  1. Connection Topology and Broker Architecture (cluster design and routing rules)
  2. Client Resilience and Transport Fallback Flow (reconnection algorithms for {{client_sdk_targets}})
  3. Concurrency Benchmarks and Capacity Model (scaling math for {{peak_concurrent_connections}})
  4. Fault Injection and Incident Runbooks (3 key outage scenarios with step-by-step mitigations) Limit response to 800 to 1300 words.

Self-review

  • Confirm jittered reconnection logic eliminates thundering herd risks on {{client_sdk_targets}}.
  • Check that broker throughput calculations support {{peak_concurrent_connections}} without message drops.
  • Validate that latency thresholds meet the {{max_latency_budget_ms}} requirement across all network paths.
AuraScore breakdown
83/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-web
technology-software
websockets
real-time-web
scalability