Notes · 11 entries
Systems, performance, and the things in between.
Why I migrated my personal site from Next.js to Astro
How I rewrote a Next.js 14 personal site as Astro 6 over a weekend. Why Astro fits a publication better than a framework, how I restored Next-style ISR via Vercel, and what the new stack unlocks.
javascriptnodejsuibestpracticestech-stackWhen everything is urgent: prioritisation for engineers on a trading floor
Generic prioritisation frameworks rank by value. A trading floor is constrained by clocks and by asymmetric risk. A working method built on four deadlines, cost of delay, release timing and reserved interrupt capacity.
bestpracticestradingHFTLow-latency C++ patterns, and what survives the move to TypeScript
Notes on Bilokon and Gunduz's paper on C++ design patterns for HFT, read from the V8 side: which techniques have a real equivalent in TypeScript, which are replaced by something else, and which do not exist.
typescriptHFTtradingc++Low LatencyNormalisation for trading data: orders, executions and reference data
The normal forms applied to an order and execution schema, where time changes what counts as a dependency, why positions are a projection and not a table to update, and the places where denormalising is the correct design.
dbdatatradingbestpracticesAggregating market time series: as-of joins, bars and forward fill
Trades and quotes never share timestamps, so combining them is a question of alignment. As-of joins instead of interpolation, OHLCV bars on half-open buckets, forward fill with a staleness limit, and the numeric pitfalls of doing it in TypeScript.
timeseriesreal-timetradingtypescriptKafka in a trading stack: where it fits, and what it guarantees
Kafka does not belong between a market-data tick and an order, and it is very good at everything after the fill. Partition keys and ordering, what idempotent producers and transactions cover, compaction for current state, and a post-trade consumer that is safe to replay.
kafkaarchitecturetradingnodejsPID control for real-time UIs: why a spring lags a moving target
A UI spring is a PD controller. Against a target that keeps moving, such as the time axis of a live chart, it settles with a constant lag of c·v/k. The control-theory reason, two fixes, and how to step the simulation independently of frame rate.
uireal-timetradingPerformanceParallelism in Node.js: what the event loop does not give you
Promise.all is concurrency, not parallelism. What actually runs in parallel in a Node.js process (the libuv pool, worker threads, shared memory), measured by the number a market-data gateway cares about: event-loop delay.
nodejsreal-timeConcurrencyPerformanceSecuring a browser-based trading UI: CSP, CORS and entitlements
What CSP and CORS actually protect in a web trading front end, the WebSocket gap that CORS does not cover, and why entitlements and order validation belong on the server whatever the client does.
javascriptwebsecuritytradingEvent-driven architecture on the order path: sequencing, backpressure, recovery
Event-driven design in trading is less about brokers and more about three decisions: who assigns the order of events, what each stream does when a consumer falls behind, and how a component recovers after a gap.
architectureevent-driventradingreal-timeArchitecture principles for trading systems
Modularity, scalability and maintainability mean something specific when the system sends orders: a protected hot path, single-writer deterministic state, explicit failure domains, capacity sized for bursts, and replay as the test harness.
architecturetradingbestpracticesSystem Design