Solution Architecture overview
80 topics in 13 lessons, each in one line. Every topic opens the page that teaches it.
After this course you can
- Turn a brief into numbers (requests per second, storage, latency and availability targets) and design to them.
- Choose and combine load balancers, caches, databases, queues, functions and containers, and say what each choice costs.
- Design for failure and disaster, secure the network and the data, and review a design against the six Well-Architected pillars.
1Requirements and estimates
- The parts of a systemWhat is a system that serves millions made of?
- RequirementsWhat it must do is easy; how well it must do it shapes the design
- Quality attributesA requirement without a number cannot be designed for or tested
- Back-of-envelope estimatesDaily users become requests per second with one division
- Storage growthData only grows: size the store for year three, not launch day
- Latency numbersA network round trip costs thousands of memory reads
- PercentilesThe average hides the slow requests; the 99th percentile shows them
- Trade-offsEvery choice gives something up; write down what and why
2Availability
- AvailabilityEach extra nine allows ten times less downtime
- Error budgetsAn SLO turns availability into a budget you can spend
- Parts in seriesA chain is less available than its weakest link
- RedundancyCopies side by side multiply up, if they fail independently
- Single points of failureFind every part that exists only once
- FailoverA standby helps only if the switch to it is quick and automatic
- Zone capacityTo survive a lost zone, the others must already carry the load
3Scaling
- Vertical scalingScaling up is simple until you reach the largest machine
- Horizontal scalingMany small servers grow without a ceiling, and a failure costs one share
- Stateless servicesMove the state out, and any server can be copied or thrown away
- SessionsKeep sessions off the server: in a shared store or a signed token
- Auto scalingAuto scaling follows the load between a floor and a ceiling
- Scaling lagReactive scaling arrives after the load; plan ahead for known peaks
4Load balancing
- Load balancersOne address in front, many servers behind, only healthy ones used
- Layer 4 and layer 7Layer 4 forwards connections; layer 7 reads every request
- Listener rulesRoute by host and path, and one entry point fronts many services
- Health checksTwo missed checks take a server out; five passes bring it back
- DNS routingDNS chooses the region before the first packet is sent
- Global routingAnycast gives one address worldwide and fails over without DNS
5Caching and content delivery
- CachingA cache answers repeated reads from memory and spares the database
- Hit ratioThe last few percent of hits cut database load the most
- Cache-asideThe application checks the cache, and fills it on a miss
- TTL and invalidationA TTL caps how stale data can get; deleting on write keeps it fresh
- Content delivery networksA CDN answers users nearby, and the origin sees only the misses
- HTTP cachingVersion file names and cache them for a year; keep the page short-lived
6Databases at scale
- Choosing a databaseChoose the database by how data is read and written
- Read replicasReplicas multiply read capacity, but each is a moment behind
- Multi-AZA synchronous standby in another zone loses nothing on failover
- Aurora storageSix copies in three zones, and every replica reads the same storage
- Partitioning and shardingSplit data by key across machines, and choose a key that spreads load
- ConsistencyRead from a copy and you may read the past
7Queues and events
- CouplingA direct call ties two services’ speed and uptime together
- QueuesA queue absorbs a spike and lets workers catch up at their pace
- Message lifecycleA message hides while it is worked on, and returns if the worker fails
- IdempotencyMessages can arrive twice; make handling safe to repeat
- Publish and subscribeA queue gives each message to one worker; a topic gives every subscriber a copy
- Event busesAn event bus routes each event by its content to whoever cares
8Monoliths, microservices and serverless
- Application shapesMonolith, microservices or serverless: where the boundaries fall
- FunctionsA function runs once per event; concurrency is requests times duration
- Serverless costFunctions cost nothing idle; steady heavy traffic is cheaper on servers
- API gatewaysA gateway does what every API needs before your code runs
- Managed containersManaged containers remove the servers but keep the container
- Service boundariesDraw boundaries around business capabilities, each with its own data
- Monolith firstMicroservices trade an organisation problem for a distributed one
9Designing for failure
- TimeoutsWithout a timeout, one slow dependency holds every thread
- RetriesRetries multiply through layers into a storm
- Circuit breakersStop calling a dependency that keeps failing, and fail fast
- Graceful degradationWhen a part fails, serve a smaller answer instead of an error
- Chaos engineeringBreak things on purpose to find weak spots before users do
10Disaster recovery
- RPO and RTORecovery has two numbers: data you may lose, time you may be down
- Disaster recovery strategiesFour strategies trade cost against recovery time
- Replication and backupsReplication copies your mistakes; only a backup goes back in time
- Cross-region failoverFail over the data first, then the traffic
- Testing recoveryA recovery plan you have not run is a guess
11Security and network design
- VPC designOnly the load balancer faces the internet
- Security groupsEach tier accepts traffic only from the tier in front of it
- Encryption and keysEncrypt data with a data key, and the data key with KMS
- IAM and least privilegeEverything is denied unless a policy allows it
- Hybrid and multi-VPC networkingConnect many networks through a hub, not a mesh
12Cost, operations and reviewing a design
- Elasticity and right-sizingYou pay for what you provision, so make it follow demand
- Purchase optionsCommit for the floor, pay on demand for peaks, use Spot for what can wait
- ObservabilityMetrics say something is wrong; traces say where the time went
- The Well-Architected FrameworkSix pillars, because a fix for one is often a cost to another
- Design reviewA review turns “is it good?” into a ranked list of risks
13A photo app from a thousand users to a millionWorked case
- The problemStart from what users do and what the business promises
- The estimateTurn users into requests a second and bytes a year
- The first designOne server is the right first design
- The limitsLimits arrive in an order you can predict
- The fixesEach limit gets its own fix
- The trade-offEvery fix gives up a little; sharding gives up the most, so it waits
- The finished designAt a million users, every part answers one limit
- A real caseInstagram at 14 million users had the same parts
Sources and credit
51 sourcesThe chapters and drawings are written by NeuroqAI from these sources. Each lesson lists its own at the end of its chapter, and figures on the pages are taken from them or computed from them.