Architettura software e microservizi

Decomposizione dei sistemi, API, comunicazione tra servizi, resilienza e compromessi architetturali.

Percorso di lettura

Questa sezione collega i concetti fondamentali ai libri che utilizzo come riferimento. Parto da un problema, individuo l’argomento e torno ai capitoli utili per comprenderlo.

Libri e percorsi della sezione

  • Building Microservices
  • Sam Newman
  • Designing Data-Intensive Applications
  • Martin Kleppmann & Chris Riccomini
  • Distributed Systems
  • Databases & Data Management
  • Computer Networks
  • Containers, Cloud & DevOps
  • Cybersecurity & Cryptography
  • Blockchain & Smart Contracts

I titoli dei libri e le note dettagliate sui capitoli sono conservati nella lingua originale.

Leggi le note complete in inglese

Software Architecture & Microservices

System decomposition, communication patterns, service boundaries, resilience, deployment and the architectural trade-offs behind distributed applications.

Software architecture is the point where many technical decisions stop being isolated choices and start interacting with one another.

Moving from a monolith to microservices, choosing synchronous or asynchronous communication, deciding where data should live, or defining how services recover from failures all have consequences that extend far beyond the technology selected.

Where should a service boundary be drawn? When is a microservice better than a modular monolith? Should two services communicate synchronously or through events? How should a workflow span multiple services without relying on a distributed transaction? How do architecture and team structure influence each other?

This section collects the books I use to reason about those decisions from both an application-architecture and a distributed-data perspective.


Topics in This Section

Software Architecture · Monoliths · Microservices · Domain-Driven Design · Bounded Contexts · Service Boundaries · REST · RPC · Messaging · Event-Driven Architecture · API Gateways · Service Mesh · Saga · Distributed Transactions · CI/CD · Deployment · Kubernetes · Testing · Observability · Security · Resilience · Circuit Breakers · Idempotency · CAP · Scaling · Conway’s Law · Evolutionary Architecture


Building Microservices

Sam Newman

2nd Edition — O’Reilly Media

Level
Intermediate → Advanced

Best for
Designing, evolving and operating microservice architectures while understanding their organisational and technical trade-offs.

Building Microservices is the book I use when I want to move beyond the simple idea that a microservice is just “a small service”.

Sam Newman treats microservices as an architectural approach built around independent deployability, business-domain boundaries, ownership of state and organisational alignment.

What I particularly value is that the book does not present microservices as an automatic improvement over monolithic systems. It repeatedly explores when they are useful, what complexity they introduce and how an architecture can evolve incrementally rather than through a complete rewrite.

What I Use It For

  • understanding when microservices are appropriate;
  • comparing monolithic, modular-monolithic and distributed architectures;
  • identifying service boundaries;
  • Domain-Driven Design concepts;
  • bounded contexts and aggregates;
  • incremental decomposition of monoliths;
  • synchronous and asynchronous communication;
  • REST, RPC, messaging and event-driven communication;
  • API gateways and service meshes;
  • Saga and distributed workflow patterns;
  • continuous integration and delivery;
  • containerised deployment and Kubernetes;
  • testing distributed systems;
  • monitoring and observability;
  • service-to-service security;
  • resilience patterns;
  • scaling;
  • Conway’s Law and team organisation;
  • evolutionary architecture.

Chapters Worth Reading

Microservice Foundations

Chapter 1 — What Are Microservices?
The defining characteristics of microservices, their advantages, their costs and the situations in which they may or may not be appropriate.

  • independent deployability;
  • business-domain modelling;
  • service ownership of state;
  • single-process, modular and distributed monoliths;
  • scaling and organisational alignment;
  • latency, testing and operational complexity;
  • when not to use microservices.
Service Boundaries & Domain-Driven Design

Chapter 2 — How to Model Microservices
How to identify meaningful service boundaries and avoid decompositions that increase coupling.

  • information hiding;
  • cohesion and coupling;
  • domain coupling;
  • pass-through, common and content coupling;
  • ubiquitous language;
  • aggregates;
  • bounded contexts;
  • Event Storming;
  • Domain-Driven Design.
Breaking Apart a Monolith

Chapter 3 — Splitting the Monolith
Strategies for decomposing existing systems incrementally rather than replacing them all at once.

  • incremental migration;
  • choosing what to extract first;
  • decomposition by code or data;
  • Strangler Fig pattern;
  • parallel run;
  • feature toggles;
  • data integrity and transaction concerns.
Communication Patterns

Chapter 4 — Microservice Communication Styles
The architectural trade-offs between different ways services exchange information.

  • synchronous blocking communication;
  • asynchronous non-blocking communication;
  • request-response;
  • communication through common data;
  • event-driven communication;
  • latency and failure implications.

Chapter 5 — Implementing Microservice Communication
Concrete technologies and practices used to implement service communication safely.

  • REST;
  • Remote Procedure Calls;
  • GraphQL;
  • message brokers;
  • serialization formats;
  • schema evolution;
  • backward compatibility;
  • service discovery;
  • API gateways;
  • service meshes.
Distributed Workflows & Saga

Chapter 6 — Workflow
How business operations can span multiple independently owned services.

  • ACID transactions;
  • distributed transactions;
  • Two-Phase Commit;
  • Saga;
  • compensating actions;
  • Saga failure modes.
Build & Deployment

Chapter 7 — Build
Continuous Integration, build pipelines, repositories and artifact management in independently deployable services.

Chapter 8 — Deployment
Deployment models and the infrastructure needed to run microservices reliably.

  • Infrastructure as Code;
  • zero-downtime deployment;
  • virtual machines;
  • containers;
  • PaaS and FaaS;
  • Kubernetes;
  • container orchestration;
  • progressive delivery;
  • canary releases;
  • feature toggles.
Testing & Observability

Chapter 9 — Testing
Testing strategies for systems composed of independently deployed services.

  • unit tests;
  • service tests;
  • end-to-end tests;
  • contract tests;
  • consumer-driven contracts;
  • production testing;
  • robustness and performance testing.

Chapter 10 — From Monitoring to Observability
How to understand system behaviour when requests cross multiple services and machines.

  • log aggregation;
  • metrics;
  • distributed tracing;
  • alerting;
  • semantic monitoring;
  • observability.
Security

Chapter 11 — Security
Security principles and identity management in distributed service architectures.

  • least privilege;
  • defence in depth;
  • Zero Trust;
  • data in transit and at rest;
  • authentication and authorization;
  • service-to-service authentication;
  • Single Sign-On;
  • JWT;
  • centralised and decentralised authorization.
Resilience

Chapter 12 — Resiliency
Patterns that allow distributed systems to continue providing useful service despite failures.

  • timeouts;
  • retries;
  • bulkheads;
  • circuit breakers;
  • isolation;
  • redundancy;
  • idempotency;
  • CAP theorem;
  • Chaos Engineering;
  • graceful degradation.
Scaling

Chapter 13 — Scaling
Different ways to increase system capacity and distribute load.

  • vertical scaling;
  • horizontal duplication;
  • data partitioning;
  • functional decomposition;
  • caching;
  • autoscaling.
Organisation & Evolutionary Architecture

Chapter 15 — Organizational Structures
The relationship between software architecture, ownership and team structure.

  • Conway’s Law;
  • team autonomy;
  • service ownership;
  • platform teams;
  • communities of practice;
  • cross-cutting changes.

Chapter 16 — The Evolutionary Architect
Architecture as an evolving set of boundaries, principles and practices rather than a one-time design exercise.

My Suggested Learning Path

Understand Microservices
Chapter 1

Define Boundaries
Chapters 2–3

Communication
Chapters 4–5

Distributed Workflows
Chapter 6

Delivery & Operations
Chapters 7–10

Security & Resilience
Chapters 11–12

Scaling
Chapter 13

Architecture & Organisation
Chapters 15–16


Designing Data-Intensive Applications

Martin Kleppmann & Chris Riccomini

2nd Edition — O’Reilly Media

Level
Intermediate → Advanced

Best for
Understanding the data, consistency and distributed-systems consequences of architectural decisions.

Designing Data-Intensive Applications complements Building Microservices by approaching architecture through the behaviour of data systems.

Where Newman focuses strongly on service boundaries, delivery, resilience and organisational design, Kleppmann and Riccomini help explain what happens to data once an architecture becomes distributed.

This is particularly useful for understanding why apparently simple architectural choices can create difficult questions around replication, consistency, transactions, failure handling and event-driven integration.

What I Use It For

  • architecture trade-offs;
  • cloud-native systems;
  • microservices and serverless;
  • nonfunctional requirements;
  • reliability and scalability;
  • data ownership and derived data;
  • schema evolution;
  • REST and RPC;
  • event-driven architectures;
  • replication;
  • sharding;
  • distributed transactions;
  • partial failures;
  • consistency and consensus;
  • batch and stream processing.

Chapters Worth Reading

Architecture Trade-Offs

Chapter 1 — Trade-Offs in Data Systems Architecture
A broad architectural view of modern data systems and the decisions involved in choosing how they are structured.

  • cloud versus self-hosting;
  • distributed versus single-node systems;
  • cloud-native architecture;
  • microservices;
  • serverless;
  • operational versus analytical systems;
  • systems of record and derived data.
Nonfunctional Requirements

Chapter 2 — Defining Nonfunctional Requirements
How system qualities influence architectural design.

  • performance;
  • latency;
  • reliability;
  • fault tolerance;
  • scalability;
  • operability;
  • maintainability.
Service Communication & Evolution

Chapter 5 — Encoding and Evolution
How independently evolving applications and services exchange data without becoming tightly coupled.

  • schema evolution;
  • JSON and binary formats;
  • Protocol Buffers;
  • Avro;
  • REST;
  • RPC;
  • event-driven architectures;
  • durable workflows.
Replication & Sharding

Chapter 6 — Replication
The consequences of maintaining multiple copies of data across machines or regions.

Chapter 7 — Sharding
How data can be partitioned to distribute storage and workload.

Transactions Across Distributed Systems

Chapter 8 — Transactions
Transaction guarantees and the problems that arise when operations span multiple components.

  • ACID;
  • isolation;
  • serializability;
  • distributed transactions;
  • Two-Phase Commit.
Failures, Consistency & Consensus

Chapter 9 — The Trouble with Distributed Systems
Partial failures, unreliable networks, timeouts and the uncertainty inherent in communication between independent machines.

Chapter 10 — Consistency and Consensus
The guarantees required when multiple nodes must agree on shared state.

Event-Driven & Dataflow Architectures

Chapters 11–13 — Batch and Stream Processing
Architectures built around dataflows, event streams, change propagation and derived state.

  • ETL;
  • batch processing;
  • message brokers;
  • event streams;
  • Change Data Capture;
  • stream processing;
  • derived state;
  • data integration.

My Suggested Learning Path

Architecture Decisions
Chapters 1–2

Service Evolution
Chapter 5

Distributed Data
Chapters 6–8

Failure & Consistency
Chapters 9–10

Event-Driven Architecture
Chapters 11–13


Why I Keep Both Books

Building Microservices

Services and organisation first.

  • service boundaries;
  • Domain-Driven Design;
  • communication patterns;
  • Saga;
  • deployment;
  • testing;
  • observability;
  • resilience;
  • team structure.

Designing Data-Intensive Applications

Data and distributed guarantees first.

  • architectural trade-offs;
  • replication;
  • sharding;
  • transactions;
  • partial failures;
  • consistency;
  • consensus;
  • event streams.

One helps me decide how to split and operate a system. The other helps me understand what those decisions do to data, consistency and failure behaviour.


Topic → Book Map

Monolith vs Microservices

Building Microservices: Chapters 1 and 3
DDIA: Chapter 1

Service Boundaries & Domain-Driven Design

Building Microservices: Chapter 2

Service Communication

Building Microservices: Chapters 4–5
DDIA: Chapter 5

Saga & Distributed Workflows

Building Microservices: Chapter 6
DDIA: Chapter 8 for distributed transaction foundations

Deployment & Kubernetes

Building Microservices: Chapters 7–8

Testing & Observability

Building Microservices: Chapters 9–10

Security

Building Microservices: Chapter 11

Resilience & Partial Failures

Building Microservices: Chapter 12
DDIA: Chapter 9

Scaling

Building Microservices: Chapter 13
DDIA: Chapters 1, 6 and 7

Event-Driven Architecture

Building Microservices: Chapters 4–6
DDIA: Chapters 5 and 11–13

Architecture & Organisation

Building Microservices: Chapters 15–16


How I Use These Books

I find architecture easier to reason about when I begin with a constraint or failure mode rather than with a technology.

“Two parts of the system change for completely different business reasons. Should they really be deployed together?”

That leads to cohesion, coupling, business-domain boundaries and eventually the question of whether those capabilities should become independently deployable services.

“A business operation needs to update three services, but there is no shared database transaction.”

That points toward distributed transactions, Saga, compensating actions and eventual consistency.

“One downstream service is unavailable. Should the failure propagate through the entire request chain?”

That leads to timeouts, retries, circuit breakers, bulkheads, idempotency and graceful degradation.

“The system works technically, but every feature requires five teams to coordinate a release.”

That leads beyond code into Conway’s Law, team ownership and the relationship between organisational boundaries and software architecture.

Start from the constraint, identify the coupling it creates, then choose the architectural pattern that manages that trade-off.


Related Areas

Software architecture connects almost every technical area in this library.

Distributed Systems

Partial failures, consistency, consensus, coordination and replicated state.

Databases & Data Management

Data ownership, transactions, isolation, consistency and distributed persistence.

Computer Networks

Latency, protocols, service communication, gateways and network failures.

Containers, Cloud & DevOps

Deployment, orchestration, autoscaling, observability and progressive delivery.

Cybersecurity & Cryptography

Authentication, authorization, Zero Trust and secure service-to-service communication.

Blockchain & Smart Contracts

Distributed state, event-driven execution, consensus and architectural decentralisation.


Torna alla biblioteca