Modernizing Enterprise Applications โ Python
A Django monolith strangled to FastAPI microservices, one seam at a time, driven by an Agentic Development Lifecycle (ADLC) and tested throughout.
What this book is
A single continuous shipping/e-commerce narrative: build a believable Django monolith with six bounded contexts (order, inventory, payment, shipping, notification, review), then strangle it to FastAPI microservices one seam at a time, in rising order of difficulty. Each pattern (ACL, CDC, outbox, saga, CQRS, service mesh) is introduced at the moment the migration forces it, every extraction is proven against the monolith's own behavior-equivalence suite before its app is decommissioned, and the whole thing is executed through an Agentic Development Lifecycle (ADLC), a disciplined Frame โ Map โ Plan โ Generate โ Verify โ Operate โ Reconcile loop with explicit human gates.
Setting Up
Toolchain (uv/Python 3.14/Django + FastAPI), Docker Engine and the compose observability stack, the repo, the ADLC ledger, how to run every example.
Why Modernize
Modernization as disciplined engineering; when microservices are a bad idea; strategies; the assessment rubric and evolution arc reframed for 2026.
The Agentic Development Lifecycle (ADLC)
What replaces the SDLC: phases, agent roles, MCP tools, human gates, the safety net, and a full worked loop on a trivial change.
The Reference Monolith
Build the Django 'before' picture: domain, apps, persistence, API, seed data, deliberate smells, and the test suite that becomes the equivalence suite.
Finding the Seams
Strategic and tactical DDD, hexagonal architecture, event storming, coupling theory, modular monolith and decomposed databases: deciding where to cut.
The Strangler Fig in Practice
The strangler family and the first two extractions (review, notification); ACL/content-based routing; going event-driven.
Data Across the Seam
Shared data โ CDC/log-tailing (+ inventory extraction) โ outbox โ event-sourcing/CQRS โ ACIDโACD.
Coordinating Across Services
Distributed transactions, choreographed saga (+ payment), orchestrated saga (+ shipping), failure modes and the resilience chassis.
Communication & Contracts
REST/gRPC/GraphQL (+ order extraction & gateway, strangler completes), the FastAPI chassis, the schema/API/service registry.
Operating the Modernized System
Deployment patterns, service mesh, observability (OTel/LGTM/Kiali) and distributed tracing, on minikube.
Delivering & Reflection
CI/CD for the strangler on GitHub Actions (the workflow files, the equivalence-gate job, the deployment jobs named explicitly), GitOps, progressive delivery, supply-chain security; then the pattern-map/chassis/anti-patterns/what's-next close.
Appendices
Reference material that supports the main narrative without interrupting it, starting with deploying the finished system to OpenShift (Helm chart, Routes, Security Context Constraints, the internal registry), verified on a real OpenShift Local cluster.