Leanpub Header

Skip to main content

FROM FLOW TO SERVICES

This book is 100% completeLast updated on 2026-07-10

Build microservices the way architects do—not by splitting code, but by discovering true boundaries. Using the NEXUS-1 digital twin, this book explores DDD, APIs, messaging, eventual consistency, sagas, resilience, and migration, showing when distributed systems are worth their cost.

Minimum price

$119.99

$159.99

You pay

Author earns

$

Also available for 5 book credits with a Reader Membership

PDF
About

About

About the Book

From Flow to Services is the architectural bridge between a well-designed modular application and a carefully designed microservice ecosystem. Rather than presenting microservices as the inevitable destination of every modern system, this book argues that distribution should be the consequence of mature boundaries—not the starting point.

Using the NEXUS-1 digital twin as a continuous case study, the book follows the evolution of a complex industrial software platform from advanced Domain-Driven Design into a realistic microservice architecture. Every architectural decision is examined through a single coherent system, allowing the reader to see not only what changes, but why those changes become necessary.

Across more than seventy chapters, the journey moves from service-boundary identification and data ownership to public contracts, asynchronous messaging, outbox and inbox patterns, sagas, eventual consistency, distributed workflows, observability, resilience, security, migration strategies, and operational readiness. Rather than presenting isolated patterns, the book demonstrates how these concepts reinforce one another inside a complete architecture.

One of the central themes of the book is intellectual discipline. It repeatedly challenges popular assumptions, showing why a bounded context is not automatically a microservice, why shared databases undermine service autonomy, why APIs must protect language rather than expose implementation details, and why every architectural benefit introduces corresponding operational costs. The objective is not to persuade the reader to adopt microservices, but to help them recognize when they have genuinely earned them.

Like every volume in the NEXUS-1 series, this book combines architectural theory with practical implementation. The explanations are grounded in C# and .NET examples while remaining focused on timeless architectural principles rather than framework-specific recipes. The emphasis is on reasoning, trade-offs, and design judgement instead of memorizing technologies.

Who This Book Is For

This is not an introductory book on software development, C#, or microservices.

It assumes that the reader already understands object-oriented programming, ASP.NET Core, relational databases, and the fundamentals of Domain-Driven Design. Familiarity with aggregates, bounded contexts, domain events, and clean architecture will significantly improve the reading experience.

The ideal audience includes:

  • Experienced .NET developers moving from modular monoliths toward distributed systems.
  • Software architects designing service-oriented platforms.
  • Technical leads responsible for system decomposition and long-term architecture.
  • Engineers who want to understand why architectural patterns exist before learning specific tools.

A Word About the Difficulty

This is one of the most demanding books in the NEXUS-1 series.

It deliberately avoids simplified "how-to" recipes in favor of architectural reasoning. Many chapters ask the reader to evaluate competing trade-offs, understand the costs of distribution, and think about language ownership, contracts, consistency, and operational responsibility simultaneously. Readers looking for quick implementation shortcuts may find the material challenging.

However, developers who invest the time will gain something more valuable than a collection of patterns: a structured way of thinking about distributed systems that remains applicable regardless of programming language, framework, or cloud platform.

Near the end of this journey, the reader should not simply know how to build microservices—they should understand when they should not.

This book is dedicated to my friend Anna, whose quiet encouragement, thoughtful attention, and genuine belief in both ideas and people became a reminder that every worthwhile journey is made possible by someone who chooses to listen.

Author: Grigorios Kyriakos Agathangelidis
Greek name: Γρηγόριος Κυριάκος Αγαθαγγελίδης
Also searchable as: Αγαθαγγελίδης ΓρηγόριοςΑγαθαγγελιδης ΓρηγοριοςGrigorios Agathangelidis.

Author

About the Author

Grigorios Agathangelidis

Grigorios Agathangelidis is a software architect and engineer with professional experience in Electrical Engineering and Software Engineering. His work focuses on designing software systems that remain understandable, auditable, and maintainable as they grow in size and complexity.

Rather than treating architecture as a collection of isolated technologies, he approaches it as a connected discipline where Domain-Driven Design, distributed systems, SQL Server, Entity Framework Core, C#/.NET, messaging, observability, and software architecture reinforce one another.

He is the creator of NEXUS-1, a browser-based educational digital-twin demonstrator built to explain complex architectural concepts through a single coherent system. Across the NEXUS-1 series, the same platform evolves from plant simulation and root-cause analysis to reinforcement learning, database design, Domain-Driven Design, EF Core, application architecture, and finally microservices. The project is intentionally educational: it is not connected to any real industrial facility and makes no claim of being operational software.

From Flow to Services represents the next architectural step in that journey. Instead of presenting microservices as fashionable technology, it explores the engineering judgement required to decide when a distributed architecture is justified—and when a well-designed modular monolith remains the better solution. The emphasis throughout the book is on explicit trade-offs, ownership, and long-term architectural thinking rather than technology trends.

His goal as an author is not simply to teach frameworks or patterns, but to help software engineers understand how large systems can evolve without losing clarity, accountability, or architectural integrity.

Author: Grigorios Kyriakos Agathangelidis
Greek name: Γρηγόριος Κυριάκος Αγαθαγγελίδης
Also searchable as: Αγαθαγγελίδης ΓρηγόριοςΑγαθαγγελιδης ΓρηγοριοςGrigorios Agathangelidis.

Contents

Table of Contents

  • Front Matter
    • Front Cover
    • Dedication
    • Standing Boundary and Copyright Note
    • Contents
    • Preface: Why Microservices Must Wait
    • How to Read This Book
    • Where This Book Sits in the NEXUS-1 Series
    • The Service-Readiness Thesis
  • Part I — Why Microservices Are Not the Starting Point
    • Chapter 1: The Microservice Temptation
    • Chapter 2: Why a Bounded Context Is Not Automatically a Service
    • Chapter 3: The Cost of Distribution
    • Chapter 4: When the Modular Monolith Is Still the Better Architecture
    • Chapter 5: NEXUS-1 Before Service Extraction
  • Part II — Finding Service Boundaries
    • Chapter 6: From Context Map to Service Candidate
    • Chapter 7: Business Capability Boundaries
    • Chapter 8: Data Ownership Boundaries
    • Chapter 9: Workflow Boundaries
    • Chapter 10: Team and Deployment Boundaries
    • Chapter 11: Service Boundary Checklist for NEXUS-1
  • Part III — Service Ownership and Data Independence
    • Chapter 12: Database-per-Service Is a Rule About Ownership
    • Chapter 13: Why Shared Databases Break Microservices
    • Chapter 14: Cross-Service References and Identity
    • Chapter 15: Local Truth vs Remote Truth
    • Chapter 16: Reference Data, Snapshots, and Replication
    • Chapter 17: NEXUS-1 Data Ownership Map
  • Part IV — APIs and Synchronous Communication
    • Chapter 18: Designing Service APIs Without Leaking the Domain
    • Chapter 19: Commands, Queries, and Public Contracts
    • Chapter 20: REST APIs Between Services
    • Chapter 21: Versioning Public APIs
    • Chapter 22: When Synchronous Calls Are Acceptable
    • Chapter 23: When Synchronous Calls Become a Trap
    • Chapter 24: API Gateway and Backend-for-Frontend for the Operator Console
  • Part V — Messaging and Asynchronous Communication
    • Chapter 25: Why Services Need Messages
    • Chapter 26: Integration Events Revisited
    • Chapter 27: Message Brokers and Delivery Guarantees
    • Chapter 28: Outbox in a Microservice Architecture
    • Chapter 29: Inbox and Idempotent Consumers
    • Chapter 30: Ordering, Duplicates, and Lost Assumptions
    • Chapter 31: Dead-Letter Queues and Poison Messages
    • Chapter 32: Event Contracts in NEXUS-1
  • Part VI — Distributed Workflows
    • Chapter 33: Process Managers Across Services
    • Chapter 34: Saga Coordination vs Choreography
    • Chapter 35: The Alarm-to-Compliance Distributed Flow
    • Chapter 36: Compensation Without Distributed Transactions
    • Chapter 37: Timeouts, Escalations, and Human Review
    • Chapter 38: What Must Never Be Hidden in a Workflow Engine
    • Chapter 39: NEXUS-1 Distributed Process Manager Example
  • Part VII — Consistency, Reporting, and Read Models
    • Chapter 40: The End of Single-Database Thinking
    • Chapter 41: Eventual Consistency in the Operator Console
    • Chapter 42: Building Reporting Projections
    • Chapter 43: Compliance Views Across Services
    • Chapter 44: Audit Trails Across Service Boundaries
    • Chapter 45: Traceability and Correlation IDs
    • Chapter 46: Explaining Delayed Truth to Users
  • Part VIII — Security, Identity, and Access Boundaries
    • Chapter 47: Authentication vs Authorization Across Services
    • Chapter 48: Service-to-Service Authentication
    • Chapter 49: Claims, Roles, and Policy Boundaries
    • Chapter 50: Secrets, Certificates, and Configuration
    • Chapter 51: Least Privilege Between Services
    • Chapter 52: NEXUS-1 Security Boundary Map
  • Part IX — Observability and Operations
    • Chapter 53: Logs, Metrics, and Traces
    • Chapter 54: Correlation IDs and Causality Chains
    • Chapter 55: Health Checks and Readiness Checks
    • Chapter 56: Resilience: Retry, Timeout, Circuit Breaker
    • Chapter 57: Deployment Units and Independent Release
    • Chapter 58: Containers and Orchestration Concepts
    • Chapter 59: Operational Dashboards for NEXUS-1
  • Part X — Migration Strategy
    • Chapter 60: From Modular Monolith to Microservices
    • Chapter 61: Strangler Fig Pattern
    • Chapter 62: Extracting the First Service
    • Chapter 63: Keeping the Old System Alive During Migration
    • Chapter 64: Contract Tests During Extraction
    • Chapter 65: Rollback and Safe Deployment
    • Chapter 66: NEXUS-1 Migration Roadmap
  • Part XI — Final Architecture
    • Chapter 67: The NEXUS-1 Microservice Candidate Map
    • Chapter 68: Service Catalog
    • Chapter 69: API and Event Catalog
    • Chapter 70: Data Ownership Catalog
    • Chapter 71: Failure Mode Catalog
    • Chapter 72: Final Pre-Implementation Checklist
  • Back Matter
    • Glossary of Microservice Terms
    • Sources and Reference Notes
    • Working Index
    • Final Consistency Audit
    • Final Checkpoint

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub