Grokking Modern Software Architecture Styles
Vote

0% completed

​

Course Introduction

Why Architecture Styles Matter

Who This Course Is For

How the Course Is Organized

How Each Lesson Works

How to Use This Course

What You Will Be Able to Do

Three teams build the same online store.

Each store lets customers browse products, pay by card and track their orders.

All three teams write clean, tested code, and all three stores work well on an ordinary day.

Then a holiday sale begins, traffic jumps, and the payment provider stops answering for ten minutes. The three stores behave very differently.

The first team built one backend application that runs in one process and uses one database. To handle the sale, it runs more copies of the whole application, even though only checkout is busy. When the payment provider stops answering, checkout requests wait for it. Because they share the process with everything else, the whole store can slow down.

The second team split the backend into separate services for the catalog, orders and payments, each with its own database. It adds capacity only to the busy services, and the payment outage is easier to contain inside the payment service. The cost appears elsewhere. A feature that touches orders and payments now needs two releases in the right order, and some failures now happen in the network between services.

The third team made checkout publish a message, "order placed", and let payment and shipping react to it on their own schedule. During the outage, customers can still place orders, and the payment requests wait in a queue until the provider recovers. The cost is that a customer may learn several minutes later that the card was declined. Following one order through the system also takes more effort.

None of these teams wrote worse code than the others. They made different decisions about structure: the parts a system has, the job of each part, how the parts communicate, and which choices will be expensive to change later. Those decisions, not the code inside any one function, set what each store does well and where it struggles. This course teaches you to see such decisions, compare them and make them on purpose.

Why Architecture Styles Matter

An architecture decision is a design decision that touches many parts or teams, takes weeks or more to change in production, and is hard to undo. Each team above made several, such as one process or many services, and direct calls or messages. Choosing the name of a function is not an architecture decision, because an editor can rename it in seconds.

An architecture style is a named, reusable set of architecture decisions with known trade-offs. A trade-off is a choice in which improving one property of a system makes another property worse. The three teams used three styles: a monolith, microservices and event-driven architecture. The word "monolith" alone states several decisions. The backend is one deployable artifact (a single packaged build shipped as a unit), it runs in one process, and it uses one database. An engineer who knows the style can predict much of the sale-day behavior described above before reading any code.

Most engineers do not choose a style on an empty page. They join a system whose style was chosen years earlier, often by people who have since left. Knowing the styles helps in both situations. You can recognize the decisions already built into the system you maintain, and see why some changes take an hour while others take a month. You can also propose a change in terms the rest of the team understands and can check: what it improves, what it costs, and whether the team can afford the difference.

Who This Course Is For

This course is written for junior and mid-level software engineers who build and maintain backend systems. You may already write features with confidence. Now you want to take part in structural decisions and explain the reasons behind them.

The course assumes that you already know three things.

  • One programming language. The code examples are written in Python, and you can switch most of them to Java, JavaScript, C# or Go.
  • HTTP. You should know what a request, a response and a status code are.
  • A relational database. You should be able to read a SQL query and know what a table and a transaction are.

You do not need prior experience with distributed systems, message brokers, a particular cloud provider or a particular framework. Every term beyond the three items above is defined in the lesson where it first appears.

How the Course Is Organized

The course has four chapters. The first builds a shared vocabulary for judging any design. The second applies that vocabulary to each style in turn. The third teaches you to make, record and review architecture decisions on a running system, and ends with three capstone projects. The fourth holds two final assessments that cover the whole course.

Architecture Fundamentals has five lessons after this one. All five use the same running example, a food-delivery app with customer, restaurant and courier apps that call one backend. The lessons return to that app and change one part of it at a time, so each idea builds on the one before it.

  1. What Software Architecture Is defines architecture, separates architecture decisions from detailed design with three questions, and introduces architecture styles.
  2. Responsibilities and Boundaries shows how to give each part of a system one clear job. It also shows how boundaries and interfaces hide what a part does inside.
  3. Coupling, Cohesion, and Dependencies explains how a change in one part forces changes in others. It also covers how to keep related code together and which way dependencies should point.
  4. Quality Attributes defines quality attributes, which are measurable properties of how well a system does its job. It covers the five that the style lessons use to judge every style (changeability, performance, availability, security and cost) and how to measure each one.
  5. Constraints and Trade-offs shows how to score options in a weighted table. It then shows how to check the winner against the team's constraints, which are limits set outside the team, such as a budget or a deadline. It also shows how to record the result in an architecture decision record (ADR), a short document that states one decision, its context and its consequences.

Architecture Styles has fifteen lessons, one for each style. The table below lists them in course order, each with its core idea.

StyleCore idea
Monolith ArchitectureAll modules ship as one deployable artifact, run in one process and share one database.
Layered (N-Layer) ArchitectureCode is split into layers by technical job, and each layer calls only the layer directly below it.
N-Tier ArchitectureThe system is split into tiers, such as presentation, application and data, that run on their own machines and talk over the network.
Client-server ArchitectureClients send requests to a server, which owns the data and the rules and returns responses.
Microservices ArchitectureEach business area is an independently deployable service that owns its data.
Service-Oriented Architecture (SOA)Shared services are reused across an organization through formal contracts, often over a central bus.
Event-driven ArchitectureParts publish events about what happened, and other parts react without the publisher knowing who listens.
Pipe-and-Filter ArchitectureData passes through a chain of independent processing steps, each with one job.
Microkernel (Plugin) ArchitectureA small, stable core holds what every use needs, and plugins add variable features.
Hexagonal (Ports and Adapters)Business rules sit inside the application and reach databases, user interfaces and other outside systems only through interfaces they define.
Clean Architecture/Onion ArchitectureCode is arranged in rings, and source code dependencies point only inward.
Broker ArchitectureAn intermediary receives each request, finds a server that can handle it and forwards it.
Peer-to-Peer ArchitectureEvery participant, called a peer, both requests and supplies resources, and peers talk directly instead of through a central server.
Space-Based ArchitectureProcessing units keep working data in a replicated in-memory store and write it to the database later, outside the request path.
Serverless ArchitectureSmall functions run in response to events on a platform the cloud provider manages, which bills only for the compute they use.

The fifteen lessons fall into four groups. Lessons 1 to 4 cover the basic structures of one application, and lessons 5 to 7 split a system into services that communicate through calls or events. Lessons 8 to 11 organize code and processing, and lessons 12 to 15 address distribution and scale.

The diagram below shows the first two chapters, the four groups of style lessons and the recommended path through them.

Course Map
Course Map

Architecture Decisions, Evolution, and Capstones has seven lessons. The first four teach the work that follows the choice of a style. They cover a practical process for comparing designs with evidence, C4 diagrams and architecture decision records, architecture reviews with seven common failure patterns, and changing a running system in small steps with the strangler fig pattern. The three capstones then ask you to apply the whole course. In the first, you review and refactor part of an existing application. In the second, you design a new learning product for a team of four engineers with a fixed launch date. In the third, you respond when that product's requirements change. Each capstone states the task, then gives a reference solution and a rubric so that you can check your own work.

Final Assessment has two lessons, each with an adaptive assessment of 25 questions drawn from a bank of 50. Final Assessment 1: Fundamentals and Core Styles covers the fundamentals chapter and style lessons 1 to 7. Final Assessment 2: Advanced Styles and Architecture Decisions covers style lessons 8 to 15 and the decisions chapter. The two do not share any lessons or questions, and many of their questions combine ideas from more than one lesson.

How Each Lesson Works

Every style lesson follows the same pattern. Once you have read one, you know where to find each kind of information in the others.

  • Know the Vocabulary. A short list of the terms the lesson uses, each defined in one or two sentences.
  • How the style works. The parts the style defines, the job of each part and how the parts communicate.
  • Worked examples. The style applied to concrete systems, such as an online store, a payment system or a concert ticketing site.
  • Code. Small programs in Python that show the style's parts, with Java, JavaScript, C# and Go versions you can switch to. Two lessons, Broker and Peer-to-Peer, rely on diagrams instead of code.
  • Diagrams. Ten or more in each lesson, each one explained by the text around it.
  • Trade-offs and when not to use it. What the style improves, what it costs and the situations in which another style fits better.
  • FAQs and Key Takeaways. Answers to common questions, then a short list of the points to remember.
  • Assessment. An adaptive assessment of 15 questions drawn from a bank of 35. Most questions describe a situation and ask which design or change fits it, and every option comes with an explanation.

Together, these sections answer three questions for every style. What does it give you, what does it cost, and which constraints does it fit?

How to Use This Course

Read the five fundamentals lessons first, in order. The style lessons judge every style by the same measures: the quality attributes it improves or harms and the constraints it fits. The fundamentals chapter defines those measures and shows how to apply them.

Then read the style lessons in order, or by need. The order starts with the structures most backend engineers already work with and moves toward more specialized ones. Later lessons sometimes compare their style with an earlier one. For example, the N-Tier lesson separates its tiers, which run on their own machines, from the layers of the Layered lesson, and states which tier each layer runs in. If your team is considering a particular style now, open its lesson directly. Read the earlier lessons when it refers to them.

Finish with the decisions chapter, and do the capstones yourself. Its lessons assume that you know the fundamentals and most of the styles. Each capstone takes several hours. Complete the task before you read the reference solution, because comparing your own answer with it is where most of the learning happens.

Check yourself with the assessments. Take each style lesson's assessment right after you finish the lesson, while you still remember the details. Take the two final assessments at the end of the course. For every question you miss, read the explanation of each option, then return to the lesson that teaches the idea.

Use each vocabulary section as a reference. Read it once before the lesson, and return to it whenever a later section uses a term you do not remember.

Apply each style to a system you know. After each style lesson, name one system you know that uses the style. Then name one system where it would be the wrong fit. This short exercise turns a description you have read into a judgment you can make yourself.

What You Will Be Able to Do

By the end of the course, you will be able to do the following:

  • Explain each of the fifteen styles and the problem it was designed to solve.
  • Read an existing system and name the styles it combines, such as a monolith organized in layers that sends notifications through events.
  • Tell an architecture decision apart from detailed design, and estimate what it would cost to reverse.
  • State a quality requirement as a measurable target, such as 99 percent of orders being placed in under 500 milliseconds.
  • Compare two or three options against quality attributes and constraints with a weighted scoring table.
  • Write an ADR for a real decision, including its costs and the conditions that would reopen it.
  • Recognize when a style is the wrong fit for a system, a team or a budget.
  • Review an existing system, rank its problems by their effect on the main requirement, and plan the smallest change that meets it, with its rollback limits stated.
  • Discuss trade-offs precisely in design reviews, naming what each option improves and what it costs.

None of these abilities depends on memorizing fifteen definitions. Each depends on asking the same questions of every option. What does it make easier, what does it make harder, and can the team afford the difference? The first lesson, What Software Architecture Is, starts with the question that every later lesson relies on: which decisions count as architecture.

Reading Progress

0%


Vote for new content

On This Page

Why Architecture Styles Matter

Who This Course Is For

How the Course Is Organized

How Each Lesson Works

How to Use This Course

What You Will Be Able to Do