Real-time Trading Dashboard: WebSocket, Redis & Sub-second Updates

Живые котировки по WebSocket: обновление UI меньше 400 мс, тысячи одновременных соединений.

Стек Kubernetes, Node.js, React, Redis, TypeScript, WebSocket

Client — fintech broker (CFD/FX), 12K daily active traders. Legacy dashboard polled REST every 3s — stale prices, client complaints, risk of orders on outdated quotes. Peak load: 8K concurrent WebSocket connections during market open.

Scope: real-time web dashboard — live quotes, order book depth, portfolio P&L, sub-500ms UI updates. Failover if feed disconnects; mobile-responsive.

  • WebSocket gateway (horizontal scale): sticky sessions, Redis Pub/Sub fan-out from price feed;
  • backend: NestJS + Redis Streams buffer, normalizer for 40+ instrument feeds;
  • frontend: React + lightweight charts, virtualized order book, reconnect with snapshot sync;
  • backpressure: drop non-critical ticks under load, always deliver bid/ask;
  • auth: JWT short-lived + refresh; session revoke on password change;
  • monitoring: connection count, lag p99, alert if lag > 1s;
  • load test: 10K connections, 50K msgs/sec burst; auto-scale K8s HPA;
  • compliance: audit log of viewed instruments (regulatory request).

Stack: React, TypeScript, WebSocket, Redis, Node.js, PostgreSQL, Kubernetes, Grafana. Acceptance: p99 tick-to-UI < 400ms under load test.

Result: support tickets «wrong price» −85%; session duration +30%. NDA: broker not disclosed.