Skip to content
Star17Hire me
01 / StartXP 0%
Stage 1-1 · Current employer (under NDA) · 2023 — Now

Real-time device platform

A device management backend that keeps 100,000+ devices connected at once. The product is under NDA, so this page covers the engineering, not the product.

Role
Senior engineer, team lead
Company
Current employer (under NDA)
Period
2023 — Now
Stack
NestJS, Socket.io, MongoDB, GraphQL
Real-time device platform cover
NestJSSocket.ioMongoDBGraphQLDockerKubernetesAWS EKSJenkins

01The problem

Every device keeps a socket open to the backend for commands and status updates. At six figures of devices, a short network blip means all of them try to reconnect in the same second, and any message lost during that window has to be delivered later.

02Approach

I built the device layer on NestJS with Socket.io and kept device state in MongoDB. Events go through a queue with at-least-once delivery, so a slow consumer delays a message instead of losing it.

The original backend was one service. We split it into NestJS services on Docker and Kubernetes, which kept one slow path from dragging the rest down and cut p95 latency by about 40%.

03Results

The platform holds more than 100,000 concurrent connections and moves millions of events a day. The demo below is a small simulation of the reconnect problem, built for this site. It isn't production code.

Live artifactTry it yourself

Runs in your browser. Nothing to install.

Interactive demo — embedded on xerk.io. The article above explains what it shows.
100K+
Concurrent connections
−40%
p95 latencyafter the services split
M/day
Events deliveredat least once

FAQ

How do you keep that many WebSocket connections reliable?

Spread reconnects out with backoff and jitter, put a queue between the sockets and the business logic, and isolate services so one failure stays contained.

Can you build a real-time system like this for me?

Yes. Book a call or message me on Upwork with how many devices or users you expect and what has to happen in real time.

Need something like this?

I'm Ahmed Mamdouh — 10+ years building systems like Real-time device platform. Scoped in one call.