Topic 03

Architectural Styles

Concept

Zoom out from individual modules to the whole system, and you reach architecture — the highest-level shape of the software, how its biggest pieces are arranged. A handful of common shapes, called architectural styles, show up again and again, and each is a different tradeoff.

You don't need to design one yet — you need to recognize the names and what each is good and bad at: the monolith, microservices, layered and MVC, client-server, and event-driven. They're not ranked best-to-worst; each fits different situations.

A quick contrast to anchor the two you'll hear most: a monolith is like one big department store — everything under one roof. Microservices are like a street of specialist shops — each independent, but you walk between them.

Two ways to shape a system
Monolith
One deployable unit holding all the features. Simple to build and run at first; harder to scale or change in pieces as it grows large.
Microservices
Many small services, each owning one job, deployed independently. Flexible at scale — but you pay for it in network calls, coordination, and operational complexity.

The Monolith

A monolith is one single deployable application — all the features, all in one program, shipped as one unit. It's the simplest way to start: everything is in one place, easy to build and run, with no network hops between parts. Its downside shows up at scale: as it grows huge, every change touches one giant codebase, and you can't scale or update one piece independently of the rest.

Microservices

Microservices split the system into many small, independent services, each owning one capability and running on its own — a "users" service, a "reminders" service, a "billing" service. Each can be built, deployed, and scaled separately by different teams. The price is real operational complexity: now you're running and connecting dozens of programs over a network, which brings its own failures and overhead. Powerful at large scale, but a heavy cost to pay too early.

MonolithMicroservices
ShapeOne deployable appMany small independent services
Good atSimplicity, easy to startScaling and updating parts independently
CostsHard to scale parts separatelyOperational complexity of many services
FitsSmall teams, early productsLarge systems, many teams

Layered and MVC

Other styles organize the inside of an app. A layered architecture stacks responsibilities — a presentation layer (the screens), a logic layer (the rules), a data layer (storage) — each talking only to the one below. MVC (Model-View-Controller) is a famous version that separates the data (Model), the display (View), and the glue that connects them (Controller). Both are really separation of concerns applied to a whole app, and they can live happily inside a monolith.

Client-Server and Event-Driven

Two more shapes describe how parts communicate. Client-server is the classic web pattern: a client (your browser or app) sends a request, a server answers — request and response, back and forth. Event-driven flips that around: instead of asking directly, parts announce that something happened ("a habit was checked off") and other parts react to those events on their own. Event-driven systems are looser and more flexible, but harder to trace, since no one is directly in charge of the flow.

Cadence starts as a sensible monolith — one app, easy for four people to build and run, no network maze. The team notes that if reminders ever grew into a huge, independently-scaling concern, they might split it into its own service. But with four people and modest traffic, that complexity would cost far more than it saves — so they don't. Choosing the simpler architecture on purpose is itself good design.

Common Confusions
  • "Microservices are always better and more modern." They add real operational cost and only pay off at scale. For small teams and early products, a monolith is often the right, professional choice.
  • "Architecture means the framework or language we use." Architecture is the shape of the system, above any framework. The same architecture can be built in many languages, and one language can build many architectures.
  • "MVC is the architecture for everything." MVC is one useful pattern for organizing an app's insides, not a universal answer. It often lives within a larger architectural style, like a monolith.
Why It Matters
  • Architecture decisions are the hardest and most expensive to reverse, so recognizing the styles helps you follow (and eventually take part in) the biggest conversations on a team.
  • Knowing monolith versus microservices — and that simpler is often right — guards you against the common trap of over-engineering an early product.
  • "Client-server" and "event-driven" describe how nearly all real systems communicate, so the names recur constantly across the rest of the field.

Knowledge Check

What is a monolith?

  • One single deployable application containing all the features
  • Many small, independent services that each run separately on their own
  • A program written in a single programming language
  • A very large database that stores all the data

What is the main tradeoff of microservices?

  • Independent scaling and deployment, at the cost of operational complexity
  • They make everything simpler with no downsides at all
  • They always result in fewer features than a monolith
  • They somehow let teams build their software without ever writing any code at all

Why might a small team deliberately choose a monolith over microservices?

  • A monolith is simpler to build and run, and microservices' complexity isn't worth it yet
  • Because building microservices on a small scale is technically completely impossible
  • Because the team isn't skilled enough for anything else
  • Because monoliths are always better in every situation

How does an event-driven style differ from client-server?

  • Parts announce events and others react, instead of asking directly for a response
  • A client simply sends off a request, and then a server sends back a response in return
  • It is a programming language for building servers
  • It makes the flow of the system much easier to trace

What is architecture, in this sense?

  • The highest-level shape of the system — how its biggest pieces are arranged
  • The specific framework or code library that the team happened to choose to use
  • The way the app's screens are visually laid out
  • The physical servers the software runs on

You got correct