Building a Todo App with 847 Microservices
I see junior developers building todo apps with ONE service. This makes me physically ill.
The Architecture
Hereβs my production-grade todo application:
βββββββββββββββββββββββββββββββββββββββββββββββ
β API Gateway (Kong) β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββββ
βΌ βΌ βΌ
βββββββββ βββββββββββββ ββββββββββββ
β Auth β β Todo-Read β βTodo-Writeβ
βServiceβ β Service β β Service β
βββββ¬ββββ βββββββ¬ββββββ ββββββ¬ββββββ
β β β
βΌ βΌ βΌ
[84 more services omitted for brevity]
Service Breakdown
- TodoItemCreationValidationService β Validates that a todo item exists before creating it
- TodoItemCharacterCountService β Counts characters (separate from words, obviously)
- TodoItemWordCountService β Counts words
- TodoItemWordCountCacheInvalidationService β Invalidates word count cache
- TodoItemEmojiFlagDetectionService β Detects if todo contains emoji (legal compliance)
- TodoCompletionCelebrationService β Sends Kafka event to trigger confetti in UI
- TodoDeletionGriefCounselingService β Handles emotional attachment to deleted todos
The Message Flow
When a user creates a todo:
- Request hits Kong β validates JWT with Auth0
- Auth0 talks to our AuthService via gRPC
- AuthService checks Redis for session
- Redis miss β query PostgreSQL
- PostgreSQL replica lag β retry with exponential backoff
- Request forwarded to TodoCreationOrchestratorService
- Orchestrator publishes to Kafka topic
todo.creation.requested.v2.internal.prod - 47 services consume this event
- Eventually consistent write to DynamoDB
- DynamoDB streams trigger Lambda
- Lambda writes to Elasticsearch
- User sees todo after 3-7 seconds
This is fine.
Infrastructure
- 23 Kubernetes clusters (one per service category)
- 847 Helm charts
- 12 Terraform modules
- 4 full-time SREs just for the todo app
- $847,000/month AWS bill
βWhy Not a Monolith?β
Because then how would I justify my title of βPrincipal Distributed Systems Architectβ?
XKCD 927 shows the problem with standardsβtoo many of them. My solution? 847 microservices, each with its own standard. Problem solved through chaos.
Dilbert predicted this in 1995 when the Pointy-Haired Boss said: βWe need to be more agile. Letβs add more layers of management.β Same energy.
Next article: Why your startup needs a Service Mesh before product-market fit.
The author has 3 todo items and 847 services. All todos are marked βin progressβ since 2019.