Tanuj Pant

Full-Stack Engineer · Distributed Systems · AI

Full-stack engineer with 7+ years building and scaling production systems, with a focus on performance, reliability, observable distributed systems and AI engineering.

The shape of the workI like building systems where the hard problems are in the architecture: coordinating work, handling failure, keeping state consistent, and making systems observable.

Selected work

Two systems, in depth

Two projects, explored from architecture to implementation — including the decisions, trade-offs, and failure modes behind them.

AI Coding Platform

An AI-powered coding platform inspired by Lovable, with isolated Kubernetes workspaces, an agent loop driven by LLM tool calling, real-time streaming, live previews, and sub-agent orchestration for focused work.

Live demo pending
Client
Session
Agent
Workspace
Request / responseEvent streamRetry / failure path
DiagramA turn is queued rather than awaited, because a coding turn takes minutes. The agent loop drives tool calls against a pod that only this session can reach, and the preview is that pod’s own dev server.
Stack
  • TypeScript
  • React
  • Node.js
  • Express
  • Bun
  • Redis
  • Kubernetes
  • LLMs

Key engineering decisions

  1. Isolated Kubernetes workspace per conversation

    Each conversation gets its own Kubernetes pod with a shared PVC, keeping generated project state isolated while allowing the pod to be recreated independently of its lifecycle.

  2. Asynchronous agent execution

    User messages are persisted first and agent work is queued through Redis, so a long-running coding task isn't tied to the HTTP request or browser connection.

  3. Separate agent and app-runner processes

    The agent is responsible for reasoning and editing files; a dedicated app-runner container owns dependency installation and the development server. Both operate on the same shared workspace.

  4. Persistent state outside the workspace

    Conversation history lives in Postgres and chat history is backed up to S3-compatible storage, allowing the system to recreate a failed pod without losing the conversation.

  5. Sub-agents work in isolated Git worktrees

    Sub-agents can work in parallel without modifying the primary workspace directly. Their changes are returned as diff artifacts that the main agent can selectively apply.

Technical deep dive4 sections

Architecture

A user message is persisted by the backend and pushed onto a Redis queue. An agent worker picks up the job, loads the conversation from Postgres, and executes the agent loop inside the conversation's Kubernetes workspace.

The workspace contains separate agent and app-runner containers sharing a PVC. The agent edits the project while the app-runner owns the development server and exposes the generated application through Kubernetes Service and Ingress. Progress flows through Redis Pub/Sub → backend → WebSocket → browser.

Reliability & Recovery

The system persists the conversation before agent execution begins, so a failed agent run doesn't lose the user's request.

Conversation state is stored in Postgres rather than process memory, while chat history is also backed up to S3-compatible storage. If a workspace pod fails, it can be recreated and the conversation restored from persistent state rather than relying on the previous pod surviving.

Performance & Scalability

Long-running agent work is asynchronous, allowing the API and WebSocket layers to remain independent of the execution time of a coding task.

The app-runner is separated from the agent so generated applications can restart independently when files change. Sub-agents can also work on isolated Git worktrees, allowing focused tasks to execute without competing over the primary workspace.

Trade-offs

A dedicated Kubernetes workspace per conversation provides strong isolation but introduces significant resource overhead.

The shared PVC simplifies communication between the agent and app-runner, but also means workspace lifecycle and storage have to be managed separately from pod lifecycle.

The architecture also deliberately keeps some production concerns open: authorization, secrets management, autoscaling, resource limits, retry/dead-letter handling, and multi-replica WebSocket scaling remain production-readiness work.

Event-Driven Perpetual Futures Matching Engine

A high-performance, fault-tolerant perpetual futures trading platform built around an in-memory matching engine and a set of services that never call each other directly.

Client
Edge
Transport
Core
Fan-out
State
Request / responseEvent stream
DiagramAn order is validated at the edge, written to a log, and matched by the single consumer of that log. Everything downstream — persistence, positions, market data — reads the result rather than waiting for it.
Stack
  • TypeScript
  • Node.js
  • Redis
  • Redis Streams
  • PostgreSQL
  • Docker

Key engineering decisions

  1. Single-instance deterministic matching

    All market tickers are processed sequentially through the matching engine so that order execution and balance-dependent decisions replay in exactly the same order after a failure.

  2. In-memory matching state

    The matching engine keeps the trading state in memory to achieve the low-latency execution path, while the database remains a durable record of transactions and positions.

  3. Application-level idempotency

    Each originating request receives a correlation ID. Consumers use that ID as the idempotency key rather than relying on the Redis Stream message ID, allowing retries of the same user action to remain safe.

  4. Snapshot + stream replay recovery

    The engine periodically snapshots its state to S3 and reconstructs the latest state by replaying Redis Stream events after the snapshot.

  5. Decoupled execution and persistence

    The matching engine publishes results to downstream streams while independent consumers handle database persistence and WebSocket updates, preventing those operations from blocking matching.

Technical deep dive4 sections

Architecture

The API backend validates authenticated requests and pushes transactions into Redis Streams. The matching engine consumes those events and maintains the exchange state entirely in memory, handling order matching, margin verification, position tracking, and PnL calculations.

Execution results are consumed independently by the DB writer and WebSocket server, keeping persistence and client updates off the matching path. The services can run as Bun processes or as containerized workloads on Kubernetes.

Determinism & Idempotency

The engine intentionally processes all tickers sequentially. This avoids distributed coordination around shared user balances and, more importantly, guarantees that replaying the same event sequence produces the same decisions.

For persistence, the system generates a correlation ID at the origin of a user action. The DB writer uses that ID as a unique key inside a database transaction, preventing duplicate mutations even when the same logical operation is delivered multiple times.

Failure & Recovery

The matching engine periodically serializes its state and stores immutable snapshots in S3. After a restart, it loads the latest snapshot and replays the Redis Stream from the corresponding offset to reconstruct the state.

This gives the system two recovery mechanisms working together: snapshots reduce replay time, while the event stream provides the missing history after the snapshot.

Performance & Trade-offs

Keeping the matching state in memory avoids database round trips on the critical execution path, with the system targeting sub-millisecond transaction execution.

The trade-off is deliberate: a single sequential engine limits horizontal scaling of the matching path. The design prioritizes deterministic execution and financial consistency over independently scaling multiple matching-engine instances.

Experience

Where the work happened

Seven and a half years building production software across three companies, from data-intensive applications to distributed systems and high-performance frontend experiences.

FreightExchange

Developer

AustraliaNov 2022 – Jan 2026
3 wks → 1-2 d
Manual processing
  • Led the migration from a monolith to REST-based microservices, defining service boundaries and the API contracts between them.
  • Designed virtualised data tables holding 10K+ records that stayed responsive under inline and bulk editing.
  • Automated carrier onboarding, rate management and invoice reconciliation, cutting manual processing from about three weeks to one or two days.
  • Integrated Stripe as part of the move to a SaaS business model, including the billing states the product had not previously had to represent.

Wootag

Software Engineer

SingaporeApr 2021 – Oct 2022
50+
Publishers served
  • Built React workflows for authoring interactive video advertising.
  • Connected the React authoring tool to a lightweight Preact ad player over iframe and postMessage, keeping the two in sync without coupling their runtimes.
  • Optimised publisher-side delivery under strict bundle-size constraints, supporting lightweight ad experiences across 50+ publishers.

Pinch / ACL Mobile

Application Developer

IndiaJul 2018 – Mar 2021
86-95%
Ingestion time cut
  • Built Vue.js and React applications end to end, owning UI architecture and the integrations behind them.
  • Redesigned high-volume CSV ingestion for files of one to four million rows.
  • Reworked background processing and database persistence, reducing end-to-end processing time by roughly 86-95%.
Technical expertise

Grouped by what it lets me build

Organised by engineering capability rather than by logo. The heading is the claim; the technologies under it are the evidence.

Full-Stack

  • React
  • Next.js
  • TypeScript
  • JavaScript
  • Node.js
  • UI architecture
  • Frontend performance

Distributed Systems

  • Microservices
  • Redis
  • Redis Streams
  • REST APIs
  • Background processing
  • Async workflows
  • Fault tolerance
  • Idempotency
  • Scalability
  • System design

Data & Performance

  • PostgreSQL
  • MySQL
  • Bulk inserts
  • Data ingestion pipelines
  • Data-intensive systems
  • Benchmarking
  • Performance optimisation
  • Large dataset processing

Infrastructure & Observability

  • Docker
  • Kubernetes
  • Service mesh
  • OpenTelemetry
  • Prometheus
  • Tempo
  • Loki
  • Grafana
  • OTLP

AI Engineering

  • Coding agents
  • LLM tool calling
  • Context management
  • Hooks
  • Compaction
  • Sub-agent orchestration
  • Custom coding-agent harnesses
Contact

Have an interesting engineering problem? Let's talk.

Interested in working together? I'd love to hear what you're building.