Loading…
While this loads — worth knowing
Redis has data structures — sorted sets, counters, pub/sub. Memcached has plain keys and nothing else.
Loading…
While this loads — worth knowing
Redis has data structures — sorted sets, counters, pub/sub. Memcached has plain keys and nothing else.
An architecture pattern is a shape a whole class of systems shares. Almost every brief — in an exam, in an interview, and at work — is one of these 16 with the names changed, so recognising the shape is most of the work. Each one below says when it is the right answer, the services it runs through, the phrases in a brief that point at it, and the trade-off it carries. Nothing has only upsides.
when the front end is files, not a server
A single-page app is a bundle of files. Nothing has to run to serve them, so nothing should. S3 holds the objects, CloudFront copies them to edge locations near each viewer, and there is no instance to patch or scale.
when ordinary requests, and nothing to patch
Request in, response out, with compute that exists only for the length of the call. API Gateway handles the front door and auth; Lambda scales with the request rate; DynamoDB keeps the latency flat as the table grows.
when the front takes more than the back can absorb
The classic answer to a spike hitting a system that cannot spike with it. Intake accepts and enqueues in milliseconds, so the customer gets an answer immediately; the worker drains at whatever rate the database can actually take. The queue is also the thing that stops an outage losing work.
when the server has to push, not be asked
A WebSocket API keeps the connection open so the server can send without being asked, and bills per message rather than per hour. Redis holds the state everyone is watching, with counters and sorted sets for ranking and pub/sub to tell the other handlers something changed.
when a normal web application that has to stay up
The shape most enterprise applications actually are. A load balancer spreads traffic across instances in more than one Availability Zone, an Auto Scaling group replaces anything that dies, and a Multi-AZ database fails over without you. Unfashionable and completely correct for a stateful app you cannot rewrite.
when a long-running service that is not a single function
Between EC2 and Lambda. The container is your unit of deployment, Fargate runs it without you owning the host, and the load balancer routes to healthy tasks. The right answer when a process must stay warm, run longer than Lambda allows, or use a runtime Lambda does not.
when one thing happens and several unrelated things must follow
The producer announces that something happened and stops caring. Each consumer subscribes to what it needs. Adding a fifth consumer later touches nothing that already exists, which is the whole reason to do it this way.
when uploads need heavy work that nobody is waiting on
Upload and processing are separate problems. The upload lands in S3 and returns immediately; the event queues the work; workers scale on queue depth and take minutes if they need to. A failed job retries without blocking the next one, and the finished asset is served from the edge.
when many devices sending small messages constantly
A stream, not a queue: the same records are read by several consumers independently and can be replayed. One consumer keeps the current state for dashboards, another writes history to S3 for analytics, a third watches for thresholds and alerts.
when questions are asked of history, not of live rows
Storage and query are separated. Everything lands cheaply in S3 in open formats, a catalog describes it, and query engines read it without a cluster running between questions. Analysts get SQL over years of data without touching the production database.
when many steps, some slow, and failures must unwind
When a process is a sequence with retries, waits and compensations, the state machine should be explicit rather than smeared across services. Step Functions holds the state, retries a step without replaying the ones before it, and gives you one place to see where any order actually is.
when reads vastly outnumber writes and the database feels it
The application asks the cache first and falls back to the database on a miss, writing the answer back as it goes. Most reads never reach the database, which is what lets a modest instance serve a large audience.
when one event, several teams, none of them blocking each other
A topic fans the message out; each consumer gets its own queue. One slow or broken consumer backs up only its own queue, and its failures retry there instead of taking the publisher down with them.
Fan-out to independent consumers in full →when traffic to AWS services must not cross the internet
A VPC endpoint gives a private route from your subnets to an AWS service, so private resources reach S3 or DynamoDB without a NAT Gateway or a public IP. Usually the answer when a compliance requirement appears in a networking question.
when users on several continents need the app to feel local
A full stack in each region and DNS sending people to the nearest healthy one. The edge absorbs the static and cacheable traffic; the regional stack handles what has to be computed near the user.
when a second region must exist, but not cost like one
Data is replicated continuously to a second region while the compute stays switched off, defined as templates. Recovery is bringing that stack up and repointing DNS — minutes, not days, at a fraction of running two production estates.
The other half is producing one from a brief that never names a service. That is what the scenarios are for: you build the architecture on a canvas and it is scored against what the brief actually requires, with the reason behind every line.