4.5.5 · D1Software Engineering

Foundations — Software architecture — layered, MVC, event-driven, microservices, serverless

2,278 words10 min readBack to topic

This is the foundations page for the parent topic. Before you read about the five styles, you must be able to see what a "module", a "dependency", "coupling", a "process", and an "event" actually are. We build each from a picture, then explain why the topic can't move without it.


0. What is a "module"? (the atom of everything)

Before any architecture, we need the thing we are drawing boundaries around.

The picture: a labelled box. Nothing more. Whether the box is 10 lines or 10,000, architecture treats it the same way — as one thing with a boundary and a name.

Why the topic needs it: every style below is a rule about how boxes may be arranged and connected. Layered stacks boxes vertically; microservices scatter them across a network. If "box" isn't clear, none of that is.

Figure — Software architecture — layered, MVC, event-driven, microservices, serverless

1. What is a "dependency"? (the arrow)

Boxes are useless alone. They talk. When box A calls a function inside box B, or reads B's data, we say A depends on B.

Why the topic needs it: the layered rule "arrows point downward only" and the event-driven idea "producers don't point at consumers" are both statements about arrows. You literally cannot read the topic without this arrow in your head.

Figure — Software architecture — layered, MVC, event-driven, microservices, serverless

2. Coupling and Cohesion (the two master words)

Now we can measure whether an arrangement of boxes-and-arrows is good. Two words do all the work — see Coupling and Cohesion for the full treatment.

Why the topic needs it: the parent says "every architecture style is a strategy to lower coupling while keeping cohesion high." These two words are the scoreboard every style is trying to win.


3. Synchronous vs Asynchronous (waiting, or not)

When box A calls box B, a question appears that the topic returns to again and again: does A stop and wait for B to answer?

Figure — Software architecture — layered, MVC, event-driven, microservices, serverless

4. Process, and "deployment unit" (what actually runs)

Boxes are code at rest. To run, code lives inside a process.

Why the topic needs it: the entire Monolith-vs-Microservices table (one deploy unit vs many, shared database vs per-service) is about how boxes are packed into processes. No "process", no table.


5. Event, Producer, Consumer, Broker (the vocabulary of decoupling)

The event-driven, microservices, and serverless sections all share one small cast of characters.

Now that producers and consumers have names, we can count them. Let us give the counts symbols.

Figure — Software architecture — layered, MVC, event-driven, microservices, serverless

Why the topic needs it: this exact fan-out formula appears in the parent's event-driven section. It is the quantitative reason to prefer a broker, and it rests entirely on the producer/consumer/broker picture above.


6. Two follow-on terms you'll meet (named now, defined in D2)

The parent uses two more phrases in its "mistake" callouts. You only need to recognise them here.

  • Eventual consistency — when data is copied across independent services, they may briefly disagree, then agree "eventually." Full treatment in Eventual Consistency.
  • Conway's Law — a system's structure ends up mirroring the communication structure of the org that built it; this is why microservices map to teams. See Conway's Law.

How the foundations feed the topic

Module = named box

Dependency = arrow

Coupling and Cohesion

Sync vs Async

Process and deploy unit

Software Architecture styles

Event Producer Consumer Broker

Layered and MVC

Event-driven

Microservices

Serverless


Equipment checklist

Cover the right side and answer out loud. If any is shaky, re-read its section before starting the parent topic.

What is a module in architecture terms?
Any named chunk of code treated as one unit — a labelled box with a boundary.
What does an arrow "A → B" (dependency) mean, and why does direction matter?
A needs B to work; changing B can break A, but changing A leaves B untouched.
We want coupling ___ and cohesion ___.
Coupling low (few arrows between boxes), cohesion high (each box does one job).
Difference between synchronous and asynchronous calls?
Sync = caller freezes and waits for the reply; async = caller drops a message and immediately moves on.
Why isn't a layered app automatically scalable?
Layers are usually boxes inside one process (a monolith); you must replicate the whole process, not one layer.
In the fan-out formula, what do and count?
= number of producers, = number of consumers.
What is a broker, and what problem does it solve?
A middle-man mailbox between producers and consumers; it cuts connections from to .
An event is phrased in which tense, and does it command anyone?
Past tense (a fact like OrderPlaced); it announces, it does not command.
Does a producer know its consumers in an event system?
No — that ignorance is exactly what makes them decoupled.