Architecture Patterns
An architecture style is a decision about where the boundaries go: which parts are built and deployed together, which talk over a network, who owns which data, and what a client sees. Every style fixes some problems and creates others. A monolith gives you one transaction and one thing to run, and one release for everyone. Microservices give each team its own release and its own scale, and take away the transaction and add a network. None of them is better in general, and the useful question is always which problem you have today.
This module compares the styles on the same requirements and then looks at the four patterns that are most often combined with them. You will compare four styles on seven requirements in an explorer, and read the reason behind each verdict. You will work out what five services in a row do to availability, how long the newest event waits when a consumer falls behind, how big a read model is and how long it takes to rebuild, how many events a snapshot saves, and how many instances a gateway needs. You will also replay a small event log in C#, sort ten situations by the idea that answers them, answer an interview question, and take a quiz.
The lessons
Section titled “The lessons”- Monolith and modular monolith (18 min). One deployable and its costs, modules with a public interface and enforced boundaries, and the explorer that compares four styles.
- Microservices: what you buy and what you pay (22 min). Independent deployment and scaling against the network, split data and operations, with the availability of a chain of services.
- Event-driven architecture: reacting to facts (22 min). Events against commands, thin and fat events, choreography, and the cost of order, duplicates and lag.
- CQRS: separate models for writing and reading (20 min). A read model shaped for the questions, how it is kept in step, and what a read side that lags costs.
- Event sourcing: state as a log of events (22 min). The state as a replay of a log, snapshots, corrections that never edit the past, and the size of the log.
- API gateway and backends for frontends (20 min). One entry point for routing and cross-cutting jobs, a backend for each kind of client, and the gateway as a risk.
- Recap and quiz (12 min). The module in one page, a checklist for choosing a style, a sorting exercise, an interview question and a quiz.
What you will be able to do
Section titled “What you will be able to do”- Separate how code is organised from how it is deployed, and say what a modular monolith keeps from a monolith and what it does not give.
- Say what microservices buy and cost, and work out the availability of a request that crosses several of them.
- Tell an event from a command, choose between a thin and a fat event, and name what gets harder in an event-driven system.
- Say when separate read and write models pay, and how a read model that lags is handled.
- Explain how event sourcing derives state from a log, what a snapshot saves, and why the past is corrected and never edited.
- Say what an API gateway should and should not do, when a backend for each client is worth its cost, and why the gateway must be sized and made redundant.
The numbers in the lessons are made up for the arithmetic. They are for comparing choices, not for predicting any real system.
Built by GhaziAlibi.
© ShardCraft. All rights reserved.