# Real-time systems — Muhammad Huzaifa Shahbaz

Canonical page: https://mhuzaifa.com/expertise/realtime-systems
Last updated: 2026-09-28
Person: Muhammad Huzaifa Shahbaz (https://mhuzaifa.com)

WebSocket backends for live code translation and IoT race control, with published latency and concurrency numbers.

## What I build

- Live translation and execution platforms where the user sees output as the program runs.
- IoT control planes that broadcast race state, staging sequences, and safety flags to connected devices.

## Architecture

- PseudoCompiler uses FastAPI and WebSockets on AWS. Lexical translation from AQA Pseudo to Python 3 streams results to the browser, with an AI chat path for errors.
- Isolated Docker runtimes execute student code. MongoDB stores sessions. LangChain coordinates the assistance steps.
- Staging Pro uses Django REST Framework, Django Channels, PostgreSQL, and Redis. Coordinators manage concurrent events; devices receive telemetry and flags.
- Race progression is logged as immutable events so the live broadcast and the audit trail are not the same write path.

## Production constraints

- PseudoCompiler is published at 50,000+ concurrent users and under 50ms translation latency, with AWS cost reduced by about 35%.
- Staging Pro processes live telemetry under 100ms so a safety flag is not a batch job.
- Fan-out is the hard part: one coordinator action has to reach every connected device without turning the database into the message bus. Redis sits in that path.

## Stack

FastAPI, Django, Django Channels, WebSockets, Redis, PostgreSQL, AWS, Docker

## Tradeoffs

- WebSockets give the latency these products need and cost more to operate than request-response HTTP, especially around reconnects and sticky sessions.
- Running untrusted student code means the isolation boundary (containers) matters as much as the translation accuracy.

## Projects

- [PseudoCompiler](https://mhuzaifa.com/portfolio/pseudocompiler): Live AQA Pseudo to Python translation and execution.
- [Staging Pro 2.0](https://mhuzaifa.com/portfolio/staging-pro): IoT race control, telemetry, and safety-flag broadcast.

## External verification

- [PseudoCompiler](https://pseudocompiler.org)
- [Staging Pro on the App Store](https://apps.apple.com/us/app/staging-pro/id6503903450)

## Questions

### What concurrency and latency numbers are published?

PseudoCompiler: 50,000+ concurrent users and under 50ms translation latency. Staging Pro: live telemetry under 100ms.

### Which stacks run those systems?

PseudoCompiler is FastAPI, WebSockets, and AWS. Staging Pro is Django, Django Channels, PostgreSQL, and Redis.
