How Medium Scaled with Microservices: Principles and Real-World Strategies

Medium transitioned from a monolithic Node.js app to a microservice architecture by adhering to three core principles—single purpose, loose coupling, and high cohesion—and implementing strategies such as dedicated services, avoiding shared storage, using Service Mesh, gRPC, Kubernetes, and comprehensive monitoring.

Java High-Performance Architecture
Java High-Performance Architecture
Java High-Performance Architecture
How Medium Scaled with Microservices: Principles and Real-World Strategies

Microservice architecture aims to help technical teams deliver products faster, safer, and with higher quality; decoupling services enables rapid iteration with minimal system impact.

Medium, founded by a Twitter co‑founder in 2012 as a large social blogging platform, started as a single Node.js monolith. As the system grew and the team expanded, it began migrating to a microservice architecture in early 2018.

Microservice Principles

In a microservice architecture, many loosely coupled services work together, each focusing on a single purpose with highly cohesive data and behavior.

Three important design principles:

Single Purpose – Each service concentrates on one goal and does it well.

Loose Coupling – Services know little about each other; changes in one service do not require changes in others, and communication occurs only via service interfaces.

High Cohesion – Services encapsulate related behavior and data; new features should involve modifications to only one service.

Microservice Principles Diagram
Microservice Principles Diagram

Following these three guidelines enables microservices to realize their full potential. Ignoring them leads to higher costs, complex deployments, and a distributed monolith.

Medium's Microservice Strategy

(1) Build New Services with Clear Value

Never create a service without clear product or engineering value. A new service must deliver tangible benefits to users or improve the development workflow; otherwise, continue evolving the monolith.

(2) Avoid Shared Persistent Storage

Sharing databases across services exposes implementation details, violating loose coupling and high cohesion. Each service should own its data, exposing it via APIs or read‑only replicas.

In a microservice architecture, a specific type of data should be owned by a single service; other services access it through APIs or maintain read‑only copies.

Example: a recommendation service needing post data.

Monolithic approach – direct access to the post table – suffers from cache invalidation, database lock‑in, duplicated business logic, and tight coupling.

Monolithic Persistent Storage
Monolithic Persistent Storage

Decoupled alternatives:

Solution A – a dedicated post service owns the data; other services call its API.

Solution B – the monolith publishes changes via a message queue to the recommendation service.

Solution C – an ETL pipeline creates a read‑only replica of post data for the recommendation service.

Solution A Diagram
Solution A Diagram
Solution B Diagram
Solution B Diagram
Solution C Diagram
Solution C Diagram

All three allow the recommendation service to own its data, enabling flexible caching and database choices.

(3) Services Focus on Their Own Business Logic

Each service should handle only its responsibilities, leaving networking, protocol, deployment, and monitoring to dedicated infrastructure.

Network – Service discovery, routing, load balancing are handled by a Service Mesh (Medium uses Istio and Envoy).

Communication Protocol – Medium chose gRPC for efficient, cross‑platform RPC, avoiding the overhead of HTTP REST+JSON for server‑to‑server calls.

Deployment – All services run in containers orchestrated by Kubernetes, with a unified build‑test‑package‑deploy pipeline.

(4) Consistent and Comprehensive Monitoring

Monitoring (logs, metrics, dashboards, alerts) is essential for understanding system behavior and troubleshooting.

Medium initially faced two problems: lack of observability due to microservice complexity, and fragmented, duplicated monitoring efforts across teams.

Complexity made monitoring difficult, reducing system visibility.

Team‑specific monitoring tools caused fragmentation and low observability.

Medium adopted DataDog for automated dashboards, alerts, and logs, and LightStep for performance tracing.

(5) Embrace Failure

Medium emphasizes failure testing, robust error handling, and automated recovery mechanisms.

Maintain awareness of potential errors.

Invest in RPC error handling.

Make failures observable.

Perform failure testing before releasing new services and maintain checklists.

Build automatic recovery mechanisms.

This article is translated and compiled from the original Medium Engineering post: Microservice Architecture at Medium .

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Backend ArchitectureMicroservicesKubernetesService Meshservice designMedium
Java High-Performance Architecture
Written by

Java High-Performance Architecture

Sharing Java development articles and resources, including SSM architecture and the Spring ecosystem (Spring Boot, Spring Cloud, MyBatis, Dubbo, Docker), Zookeeper, Redis, architecture design, microservices, message queues, Git, etc.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.