Living Systems Handbook microservices as humans Bipin Singh
The ecosystem

Post office, loudspeakers and city gates

2 min readChapter 20 of 34By Bipin Singh

A society needs infrastructure for communication: post offices for letters, loudspeakers for announcements, and gates where visitors enter. In AWS these are SQS, SNS and API Gateway.

The post office: SQS

Every human that does background work should have an inbox (an SQS queue):

Feature Human meaning
Messages wait until processed Letters stay in the box until read
Visibility timeout While you're reading a letter, nobody else gets it
Retries If you fail to handle it, it goes back in the box
Dead-letter queue After several failures, the letter goes to a "problem letters" box for a person to examine
FIFO queues Strict order and no duplicates, when sequence matters

Connecting an inbox to a Lambda function in CDK:

import { SqsEventSource } from "aws-cdk-lib/aws-lambda-event-sources";

chefCookFn.addEventSource(new SqsEventSource(chefInbox, {
  batchSize: 10,
  reportBatchItemFailures: true, // only failed letters are retried, not the whole batch
}));
Tip

Always alarm on messages in a dead-letter queue. A growing pile of problem letters means customers are silently being let down.

Loudspeakers: SNS

SNS pushes one message to many subscribers at once — queues, functions, email, SMS, mobile push. Use it for:

EventBridge and SNS overlap; as a rule of thumb, EventBridge is the town square for events between services (rich filtering, many targets, archive/replay), while SNS is the loudspeaker for very high fan-out and direct notifications.

The city gate: API Gateway

Outsiders — customers' phones, the web UI, partners — enter through a gate. Amazon API Gateway is that gate:

Gate duty Feature
Check identity JWT authorizers (Cognito), IAM, Lambda authorizers
Control crowds Throttling, usage plans per partner
Direct visitors Routes to the right human (/orders → Waiter, /payments → Cashier)
Speak many languages REST/HTTP APIs and WebSockets
Keep a register Access logs

One gate for the whole society (a shared HTTP API with routes per human) is simple and cheap. Large societies sometimes give each human its own API and put a domain name in front of all of them.

The society's senses: the UI

The UI is how the whole society perceives the outside world — the menu customers see, the button they press, the QR code they scan. It isn't a human itself; it's the sensory surface that turns people's actions into requests and events.

UI hosting Serverless option
Static website (React, Vue, plain HTML) S3 + CloudFront
Full-stack web with CI/CD AWS Amplify Hosting
Live updates (order status) API Gateway WebSockets or AppSync subscriptions

Visitors who can't wait vs those who can

Key idea

Letters (SQS) carry work reliably, loudspeakers (SNS) broadcast, the town square (EventBridge) shares facts, and the gate (API Gateway) decides who may enter — together they make a society that stays calm under pressure.

Bipin Singh
Written by Bipin Singh

Senior Full-Stack Engineer · AI & AWS. I design and build serverless systems on AWS — and love explaining them simply.

Work with me