Systems · 2024
Real-Time Messaging
A real-time messaging system where I built many of the pieces applications usually inherit from frameworks: storage, authentication, validation, concurrent access, patch operations, persistence, and live updates.
Go · TypeScript · SSE · concurrency
How it works
The browser client is TypeScript and the backend is written in Go around a hierarchical database/document/collection API.
JSON Schema validates data on the wire, token-based authentication controls access, patch operations update documents without replacing them, and Server-Sent Events push live changes to connected clients.
A concurrent skip list handles thread-safe access while persistence happens asynchronously.
Outcome
The system achieved more than 90% test coverage across the main concurrent and end-to-end workflows and gave me a much deeper understanding of what sits underneath a “simple” messaging product.