Wire Formats Compared: Protobuf, Cap'n Proto & FlatBuffers

Every microservice architecture faces a fundamental question: how should services encode data when communicating? The answer matters enormously at scale. When you’re transferring terabytes daily between services, serialization format determines network bandwidth costs, latency, CPU utilization, and ultimately whether your system can handle peak load. A poorly chosen format can double your AWS bill or add 50ms to every request; a well-chosen format essentially disappears from your performance profile. This article examines wire formats for service-to-service communication in distributed systems handling extreme data volumes. We analyze JSON, MessagePack, Protocol Buffers, FlatBuffers, Cap’n Proto, Apache Avro, and Apache Thrift, implementing each in Rust and measuring their performance characteristics. Through mathematical modeling and empirical benchmarks, we determine when each format excels and quantify the cost implications of format choices at terabyte scale. ...

November 24, 2025 · 26 min · 5411 words · Svein Erik

Building an MCP Server in Go: Graph Tools & Access Control

Consider a social media platform with 8 million users facing a content moderation bottleneck: hate speech reports take 4-6 hours to reach moderators, and at scale—120,000 reports per week—harmful content stays visible long enough to go viral. By building an MCP server in Go to expose moderation graphs and access controls to AI-powered triage, response time could drop to under 2 minutes—a 180× improvement—while accuracy increases from 67% (keyword-based) to 94% (context-aware AI analysis). The architecture shift isn’t just about speed. It’s about building composable tools that can understand social graphs, enforce access hierarchies, and apply legal frameworks programmatically. ...

March 25, 2025 · 30 min · 6240 words · Svein Erik

Caching Strategies: Cache-Aside, Write-Through & Eviction

Caching is a classical systems technique that reduces access latency by retaining temporary replicas of data closer to the point of consumption. A typical deployment comprises a backing store (for example, a relational database) that maintains the authoritative copy and one or more cache layers that materialize frequently accessed subsets. Although caching shares certain characteristics with colocation and replication, it introduces its own spectrum of latency, consistency, and operational trade-offs. This note surveys the conceptual foundations of caching and examines the strategies that practitioners employ in production systems. ...

February 14, 2025 · 47 min · 9937 words · Svein Erik

Social Media Platform Architecture at Scale

Modern social media platforms serve billions of users with sub-second latency requirements while handling massive write throughput and complex relationship graphs. This article examines the systems architecture required to build an Instagram or Facebook-scale platform, analyzing the mathematical models, algorithmic optimizations, and distributed systems patterns that enable performance at scale. Building a social media platform that can scale to billions of users is one of the most challenging problems in distributed systems. Unlike e-commerce sites with predictable traffic patterns or enterprise applications with controlled user bases, social platforms face extreme challenges: viral content creates massive traffic spikes, the social graph creates complex data dependencies, and user expectations demand instant updates. When Kim Kardashian posts a photo, millions of users want to see it within seconds—the system must handle this gracefully while simultaneously serving billions of other requests. ...

October 8, 2023 · 30 min · 6219 words · Svein Erik

The Actor Model: Concurrency Through Message Passing

Introduction As modern systems evolve toward distributed, highly parallel architectures, traditional concurrency techniques—locks, mutexes, and shared memory—quickly reveal their limitations. Deadlocks, race conditions, complex state coordination, and scaling bottlenecks become the norm rather than the exception. The Actor Model offers a radically different paradigm. Instead of sharing memory between threads, actors communicate by sending immutable messages, allowing systems to scale horizontally, avoid shared-state complexity, and model real-world workflows with surprising elegance. ...

April 17, 2022 · 34 min · 7033 words · Svein Erik