SLIDE DECK: MICROSERVICE FUNDAMENTAL (MODULE 1)#
Total Duration: 4 hours Audience: Fresher (with knowledge of 1 web framework), Employee (Up-skill/Re-skill)
Slide 1: Title Page
Content:
(Company / Training Unit Logo)
MODULE 1: MICROSERVICE FUNDAMENTAL
THE STRATEGY OF BREAKING THE MONOLITH
Trainer: (Your Name)
Date: (Training Date)
Visualization:
Clean, professional layout.
A key visual representing the âbreakdownâ of one large cube (Monolith) into multiple smaller cubes (Microservices) flying apart.
Instructor Script:
âWelcome, everyone, to Module 1: Microservice Fundamental. I am (Your Name), and over the next 4 hours, we will dissect one of the hottest, most misunderstood, yet most powerful topics in modern software architecture.â
âWe wonât just learn âWhat is a microservice.â We will learn âWHYâ it exists, âWHENâ to use it, and most importantly, âHOWâ to start migrating from a traditional Monolithic architecture. My goal is that after today, you will be able to think like an architect, not just a developer.â
Slide 2: Session Agenda
Content:
AGENDA (4 HOURS)
P1. Architectural Context (Monolith vs. Microservice)
P2. Design Principles (DDD & Database)
P3. Implementation Strategy (Strangler Fig Pattern)
P4. Implementation Lab (Demo & Hands-on)
P5. Optimization & Critique (Best Practices & Anti-Patterns)
P6. Real-world Case Study (Case Study: Uber)
P7. Assessment & Reinforcement (Quiz & Homework)
Visualization:
A horizontal timeline or 7-step diagram. Each part is a âstation.â Part 4 (Lab) is highlighted in a different color to emphasize âhands-on.â
Instructor Script:
âThis is our 7-part agenda. Weâll start with the core theory in Parts 1 and 2, learn the strategy in Part 3. After that, we will âroll up our sleevesâ for real coding in Part 4.â
âBut what I want you to pay close attention to is Part 5, where we will âcritiqueâ the very idea of microservices. Weâll finish by connecting it to reality with a massive case study before we check our knowledge.â
Slide 3: Learning Objectives
Content:
OBJECTIVES (AFTER THIS MODULE, YOU WILL BE ABLE TOâŠ)
1. Distinguish: Clearly articulate the pros and cons of Monolith vs. Microservice.
2. Identify: Explain the âBounded Contextâ concept for service decomposition.
3. Explain: Defend the âDatabase per Serviceâ principle and understand why a shared DB is an âanti-pattern.â
4. Strategize: Describe and apply the âStrangler Fig Patternâ to refactor a Monolithic application.
Visualization:
Use 4 strong icons corresponding to the 4 verbs: [Icon: Scales/Balance], [Icon: Radar/Eye], [Icon: Brain], [Icon: Map/Strategy].
Instructor Script:
âThis is my commitment to you. This isnât a high-level overview. By the end of these 4 hours, you must be able to do these 4 things. Especially points 3 and 4. You must be able to explain âwhy notâ and strategize âhow toââthat is the difference between a Junior and a Senior.â
Slide 4: Requirements & Handover (Internal)
Content:
FOR AN EFFECTIVE SESSION
Pre-requisites:
Basic knowledge of Python & REST APIs.
Experience with 1 Web Framework (Django/FlaskâŠ).
Installed: Python 3.9+, Docker Desktop, Nginx, VS Code.
Handover Package (Internal Note):
This guide is sent to the TO (Training Officer) to prepare the Lab environment.
Trainerâs Notes (teaching guide) are saved on SharePoint for other Trainers.
Visualization:
Split the slide into 2 columns.
Column 1 (Requirements): [Icon: Checklist] with clear bullet points.
Column 2 (Handover): [Icon: Folder/Package] - Demonstrates professionalism and systematic process.
Instructor Script:
â(For Leader/Admin role) This slide is for our operations team. TO team, please ensure all trainees have received the environment setup email.â
â(For Trainees) I am assuming you have all met these requirements. We will not stop to âteachâ what an API is or âinstallâ Python. We are focusing on architecture.â
â[TRAINERâS NOTE:] This slide demonstrates your âSystem Thinkingâ. It shows you not only prepare content, but also the âprocessâ for others (TO, other Trainers), helping to scale the teamâs capability.â
Slide 5: Part 1 - Architectural Context
Content:
PART 1
ARCHITECTURAL CONTEXT
Monolith vs. Microservice
Visualization:
Simple title slide, large, clear font.
An image of a fork in the road, one path labeled âMonolithâ (straight, wide road), the other âMicroserviceâ (a road splitting into many small paths).
Instructor Script:
âLetâs begin Part 1. Before we can learn about Microservices, we must deeply understand its âenemyâ, or more accurately, its âpredecessorâ: The Monolithic Architecture.â
Slide 6: What is a Monolith?
Content:
MONOLITHIC ARCHITECTURE
Concept: The entire application (UI, Logic, Data Access) is built, packaged, and deployed as a single unit.
Example (Python): A standard Django project with multiple âappsâ (Users, Products, Orders) but all:
Share one codebase.
Run in one server process (gunicorn).
Connect to one database.
Analogy: A large Supermarket. Everything is in one building.
Visualization: *
A simple diagram:
[Browser] -> [Web Server (1 large block: UI, Logic, Data)] -> [1 Database]
Instructor Script:
âThis is the most ânaturalâ architecture. When you run
django-admin startproject, you are creating a Monolith. Everything is in one place. Like a supermarket, whether you want vegetables, meat, or diapers, itâs all in that one building.ââItâs simple to develop at first, easy to debug because youâre just jumping between functions (in-process calls). But the problems begin when this âsupermarketâ gets too big.â
Slide 7: Monolith - Pros and Cons
Content:
THE âBIG BALL OF MUDâ
Pros:
[Icon: Check]Fast initial development.[Icon: Check]Easy to Debug & Test (End-to-End).[Icon: Check]Simple deployment (Deploy 1 unit).
Cons - The Pain:
[Icon: X]Difficult to Scale: Only 1 module (Payment) is busy, but you must scale the entire app.[Icon: X]Technology Lock-in: âLockedâ into 1 stack (e.g., Django 2).[Icon: X]Slow CI/CD: A small change requires a full rebuild/redeploy. High risk.[Icon: X]âBall of Mudâ: The codebase grows, modules become tightly coupled.
Visualization:
Split into 2 columns, Pros/Cons. The âConsâ column should take 2/3 of the slide and be colored red to emphasize the âpain.â
An image of an actual âbig ball of mudâ for illustration.
Instructor Script:
âIts advantages are clear: fast and simple at the start. But as the company grows, your âsupermarketâ gets bigger and bigger, and it turns into a âbig ball of mudâ.â
âImagine itâs Black Friday. Only the âPaymentâ gateway is congested. With a Monolith, you canât just add 50 more payment counters. You have to clone the entire supermarket! Build 3 more identical supermarkets just to handle the payment bottleneck. Itâs an incredible waste of resources.â
âThat is the core reason Microservices were born.â
Slide 8: What is a Microservice?
Content:
MICROSERVICE ARCHITECTURE
Concept: An architectural style that structures an application as a collection of small, autonomous services.
Characteristics:
Services are organized around business capabilities.
Independently developed, deployed, and scaled.
Communicate via APIs (REST, gRPC) or Message Queues.
Analogy: A Shopping Mall.
Visualization: *
[Image of Microservice architecture diagram]
* Diagram: `[Browser] -> [API Gateway] -> [Service A], [Service B], [Service C]...`
* Each Service (A, B, C) is its own block, perhaps drawn in a different color.
Instructor Script:
âAnd here is the solution: Microservices. Instead of building one supermarket, we build a Shopping Mall.â
âEach âstoreâ (The Nike Store, The Apple Store, The Food Court) is a âserviceâ. Each store manages its own staff, its own inventory (private database), and can renovate (deploy) itself without shutting down the entire mall.â
âThey communicate through the âcommon hallwaysâ or the âmall managementâ (which is the API Gateway or Message Queue).â
Slide 9: Microservice - Pros and Cons
Content:
THE TRADE-OFFS
Pros:
[Icon: Check]Flexible Scaling: Scale only the service (store) you need.[Icon: Check]Independent Deployment: Team A deploys without affecting Team B.[Icon: Check]Polyglot Technology: Service A (Python), Service B (Go).[Icon: Check]Team Autonomy (Ownership): Small, autonomous teams. âYou build it, you run it.â
Cons - The NEW Pain:
[Icon: X]Operational Complexity (DevOps): Needs API Gateway, Service Discovery, Centralized LoggingâŠ[Icon: X]Network Latency: API calls are always slower than in-process calls.[Icon: X]Data Consistency: The biggest challenge (to be covered in Module 2).
Visualization:
Split into 2 columns, Pros/Cons. This time, the âConsâ column is also emphasized (in orange).
An image of a complex, tangled network grid to illustrate the complexity.
Instructor Script:
âSounds like a âsilver bulletâ, right? This is where we need âCritical Thinkingâ. Microservices solve 4 big problems of the Monolith.â
âBUT, they create 3 new problems. And these 3 problems are even harder.â
âYouâve traded one complex âblockâ for one complex ânetworkâ. Now you need an extremely strong DevOps team. You have to handle network calls that can fail at any time. And the biggest headache: how to keep data consistent when âOrdersâ are in DB 1, but âPaymentsâ are in DB 2?â
âThese are the trade-offs. There is no free lunch.â
Slide 10: Monolith vs. Microservice (Comparison)
Content:
HEAD-TO-HEAD COMPARISON
(A detailed comparison table)
Criteria
Monolith
Microservice
Deployment
Single Unit
Multiple, Independent Units
Scaling
Scale Entire App
Scale Individual Service
Technology
Locked-in (1 stack)
Polyglot (Diverse)
Database
Shared
Private (Per Service)
Coupling
Tightly Coupled
Loosely Coupled
Complexity
Internal (Code)
Operational (DevOps)
Visualization:
A clear comparison table filling the slide. The last row (âComplexityâ) is highlighted.
Instructor Script:
âHere is the summary table for both architectures. Look at the last row. Both are âcomplexâ, but in different places.â
âThe Monolith is complex inside the codebase. The Microservice is complex outside, at the operational level.â
â[ASK TRAINEES:] So when should we choose which one? (Let them think for 10s). Weâll answer that in Part 5, but for now, letâs move on to âIf weâve chosen Microservices, how do we do it right?ââ
Slide 11: Part 2 - Design Principles
Content:
PART 2
DESIGN PRINCIPLES
How to âsplitâ a Service correctly?
Visualization:
Title slide.
An image of a large rock (Monolith) and a chisel, poised to strike. The question is: âWhere to strike?â
Instructor Script:
âOkay, weâve decided to âbreakâ the Monolith. But where do we hit it? How do we âsplitâ the service?â
âIf you split it wrong, you will create something even worse than a Monolith, called a âDistributed Monolithââa mess of services that are still tightly coupled by business logic and data. Part 2 will give us the âcompassâ to split it correctly.â
Slide 12: Principle #1: Bounded Context (DDD)
Content:
PRINCIPLE #1: BOUNDED CONTEXT (DDD)
Concept: From Domain-Driven Design (DDD).
It is a logical boundary within which a specific business term has a consistent, unambiguous meaning.
Classic Example: The word âProductâ
SalesContext: âProductâ = Price, Description, Image.InventoryContext: âProductâ = Stock (SKU), Location, Weight.SupportContext: âProductâ = Manuals, Ticket History.
Golden Rule: 1 Microservice â 1 Bounded Context.
Visualization:
Slide split into 3 columns:
Sales,Inventory,Support.The word âPRODUCTâ is in the middle.
Each column lists the different attributes of âProductâ within that context.
Instructor Script:
âThe first and most important principle: Bounded Context. This term is a bit academic, but the idea is extremely simple.â
âAsk the âSalesâ department and the âWarehouseâ (Inventory) department âWhat is a Product?â. They will give you two completely different answers.â
âSales cares about âPriceâ, âImageâ. The Warehouse cares about âWeightâ, âShelf Locationâ. These two concepts, despite having the same name âProductâ, are different things from a business perspective.â
âEach of those âmeaning zonesâ is a âBounded Contextâ. And the golden rule is: A Microservice should be designed to envelop one Bounded Context. Never create one generic âProductâ service, because it will violate the Bounded Contexts of both Sales and Inventory.â
Slide 13: Bounded Context (Visualization)
Content:
DRAWING THE BUSINESS BOUNDARIES
Donât split by technology, split by business.
WRONG (Anti-pattern):
UserService(CRUD)ProductService(CRUD)OrderService(CRUD)
RIGHT (By Bounded Context):
Identity & Access(Manages logins, identity)Catalog(Manages products for Sales)Inventory(Manages warehouse stock)Ordering(Manages the ordering process)Payment(Manages payments)
Visualization: *
A diagram showing a Monolith (E-commerce) being âsplitâ into Bounded Context blocks (as listed in the âRIGHTâ column). Arrows show relationships between contexts (e.g.,
Orderingdepends onCatalogandPayment).
Instructor Script:
âThis is the most common mistake. Developers split services by technology or by database table. You create a
UserServicejust to CRUD the User table. This is wrong!ââYou must split by business capability. Instead of
UserService, thinkIdentity Service(the business of identity). Instead ofProductService, thinkCatalog Service(the business of sales) andInventory Service(the business of warehousing).ââThis diagram [point to diagram] is a âContext Mapâ. Itâs a map of your business domains. This is a mandatory step before you write a single line of microservice code.â
Slide 14: Principle #2: Database per Service
Content:
PRINCIPLE #2: DATABASE PER SERVICE
Concept: Each microservice must own its data and have a private database.
Anti-pattern: 2 services (e.g.,
OrderandUser) pointing to 1 Shared Database.WHY IS THIS AN âANTI-PATTERNâ?
Hidden Coupling:
Userservice changes theUserstable schema ->Orderservice âdiesâ for no obvious reason.No DB Optimization:
Catalogservice (read-heavy) wants to useElasticsearch, butPaymentservice (transactional) wantsPostgreSQL. Impossible!
Visualization: *
Diagram 1 (WRONG):
[Service A],[Service B]-> both pointing to[Shared DB]. A big âXâ over it.Diagram 2 (RIGHT):
[Service A] -> [DB A],[Service B] -> [DB B]. A big âCheckâ mark.
Instructor Script:
âThe second golden rule, and the one most violated: One service, one database. I repeat: One service, one database.â
âThis [point to Diagram 1] is what I call a âDistributed Monolithâ. Youâve separated the code, but youâre still chained together at the data layer. This is âhidden couplingâ.â
âImagine the
Userteam decides to rename theusernamecolumn toemail. They deploy. 3 seconds later, yourOrderservice âdiesâ because its querySELECT username FROM usersfails. You canât deploy independently, so whatâs the point of âmicroservicesâ?ââNot to mention, you lose all optimization. The âCatalogâ (Search) team wants to use Elasticsearch for speed, but the âPaymentâ team needs ACID, they need PostgreSQL. When you share a DB, you will âfightâ over who gets priority.â
Slide 15: âBut I need the dataâŠâ
Content:
CHALLENGE: HOW TO âJOINâ DATA?
Problem:
Orderservice (hasuser_id) needs theuser_namefrom theUserservice.Way 1: API Call (Synchronous):
Orderservice callsGET /users/{user_id}on theUserservice.Con: Tightly coupled. If
Userservice is down,Orderservice is down.
Way 2: Data Replication (Asynchronous):
Orderservice creates its ownuserstable (with justidandname).When the
Userservice changes data (create/update), it âpublishesâ an Event (e.g.,UserUpdated).Orderservice âlistensâ for that event and updates its own privateuserstable.
Way 3: API Composition (Next Module)
Visualization: *
Diagram 1 (Sync):
[Order] --(API Call)--> [User] --(Response)--> [Order]. Has an hourglass (waiting) icon.Diagram 2 (Async):
[User] --(Event)--> [Message Queue] <-- (Listen) -- [Order].
Instructor Script:
âThis is the million-dollar question. âOkay, I split the DB. Now my Order service has a user_id. How do I get the userâs name? I canât
JOIN!âââYou have two main ways. Way 1, the lazy way: Direct API call. [Point to Diagram 1] The Order team calls the User teamâs API. This is fast, but it âcouplesâ the two services. If the User service is slow or down, the Order service âdiesâ with it. This is a âcascading failureâ.â
âWay 2, the architectâs way: Asynchronous communication. [Point to Diagram 2] When a new user is created, the User service âshoutsâ (publishes an event) into a âpublic speakerâ (Message Queue). The Order service (and 10 other services) âhearsâ it, and updates its own copy of the data it needs (e.g.,
user_idanduser_name) in its own database.ââWay 2 is more complex, but the services are completely âdecoupledâ. User service is down? Order service still runs perfectly because it has its own copy. This is called âEventual Consistencyâ, which weâll cover in Module 2.â
Slide 16: Part 3 - Implementation Strategy
Content:
PART 3
IMPLEMENTATION STRATEGY
Okay, I have a Monolith, I have the principles. Where do I start?
Visualization:
Title slide.
An image of a construction site, with an old building (Monolith) and a new building being erected right next to it.
Instructor Script:
âWe have our âcompassâ (DDD, Database per Service). Now itâs time to build. But we canât just âstopâ the live system (thatâs making money) for 6 months to do a rewrite.â
âDoing that fails 99% of the time. We need a ârefactorâ strategy that is safe, gradual, and doesnât disrupt the system.â
Slide 17: Strangler Fig Pattern
Content:
STRANGLER FIG PATTERN
Name: Inspired by the Strangler Fig vine that grows around a host tree. Its roots wrap around, grow upwards, and âstrangleâ the host. Eventually, the host tree dies, and the fig vine replaces it.
Concept: A refactoring strategy that allows you to gradually replace parts of a Monolith with new Microservices.
Idea: Place a âFacadeâ in front of the Monolith. Gradually âcutâ traffic and redirect it to new services.
Visualization:
A real photo of a Strangler Fig vine âstranglingâ a host tree. Place this next to the architectural diagram.
Instructor Script:
âAnd here is the most elegant strategy, named by Martin Fowler: The Strangler Fig Pattern.â
â[Point to photo] This image is very literal. The âhost treeâ is your Monolith. The âfig vineâ is your new Microservices. You donât chop down the host tree (old system) immediately. You âplantâ new services beside it, âclingingâ to it.â
âThe new services gradually take all the ânutrientsâ (i.e., traffic, requests) from the old tree. Until one day, the old tree (Monolith) isnât doing anything anymore, and you can safely âunplugâ it.â
Slide 18: Strangler Fig - How it Works (3 Steps)
Content:
HOW DOES THE STRANGLER FIG WORK?
Step 1: The Facade
Install a Reverse Proxy (Nginx, Traefik, API Gateway) in front of the Monolith.
All 100% of user traffic now goes through this Proxy.
Step 2: The New Service
Identify 1 Bounded Context to split (e.g.,
Notifications).Build the new
Notificationservice (e.g., with FastAPI) with its own DB.
Step 3: The Redirect
Configure the Proxy: âIF the request is
/api/notifications-> route it to the New Service (FastAPI).ââALL OTHER requests (
/api/users,/api/ordersâŠ) -> route them to the Old Monolith (Django).â
Visualization: *
A 3-state diagram:
Day 1:
[User] -> [Proxy] -> [Monolith](100% traffic)Day 30:
[User] -> [Proxy].../notifications -> [New Service](10% traffic).../ (rest) -> [Monolith](90% traffic)
Day 90:
[User] -> [Proxy].../notifications -> [New Service].../products -> [New Service 2].../ (rest) -> [Monolith (now smaller)]
Instructor Script:
âHere are the 3 implementation steps. Very simple, conceptually.â
âStep 1, the most important: Put a Proxy in front as a âfacadeâ. If you donât have one, this is your first task. All users will talk to the Proxy, not directly to the Monolith anymore.â
âStep 2: Pick one low-risk business capability (e.g., Sending notifications) and build it as a new service, with its own DB.â
âStep 3: The magic is here. You go into the Proxy (Nginx) and add one rule: âAnyone calling
/api/notifications, donât go to the old house (Monolith), turn and go to the new house (New Service).â [Point to Diagram 2]ââAnd thatâs it! You have successfully âstrangledâ one piece of functionality. The user has no idea anything changed. You repeat this process for
/products,/payments⊠until the Monolith is âdeadâ.â
Slide 19: Part 4 - Implementation Lab
Content:
PART 4
IMPLEMENTATION LAB
Strangling the âCommentsâ Service from a Blog Monolith
Visualization:
Title slide.
Icons: [Icon: Keyboard], [Icon: Code], [Icon: Terminal].
Instructor Script:
âEnough theory! Time to code. We are going to implement the Strangler Fig Pattern, for real.â
âOur problem: We have a Blog Monolith (built in Django) that manages both
PostsandComments. Our mission: Strangle theCommentsfunctionality into its own separate service (built in FastAPI) without any downtime.â
Slide 20: Lab - Architecture (Before & After)
Content:
CURRENT STATE (BEFORE)
[Browser] -> [Django Gunicorn (Port 8000)]/posts/<id>(Gets post + comments)/api/comments/(Creates comment)DB:
blog_db(sharedPostandCommenttables)
TARGET STATE (AFTER)
[Browser] -> [Nginx Proxy (Port 80)]/posts/<id>(Django) -> Internal Call ->[Comment Service (Port 8001)]/api/comments/-> Redirect ->[Comment Service (Port 8001)]
New Service: FastAPI (Port 8001) +
comments_db(Private DB)
Visualization:
Slide split into âBeforeâ and âAfterâ halves with two clear architectural diagrams.
The âAfterâ half must clearly show the role of the Nginx Proxy and the new FastAPI service (in a different color).
Instructor Script:
âThis is our âBeforeâ and âAfterâ diagram.â
â[Point to âBeforeâ] Currently, Django handles everything on port 8000. Post and Comment share one DB.â
â[Point to âAfterâ] This is our goal. We will put Nginx at the âfront doorâ (port 80). We will build a new FastAPI service on port 8001, with its own database.â
âThen, we configure Nginx: If anyone calls
/api/comments/(to POST a new comment), Nginx will âsteerâ (redirect) this traffic straight to FastAPI.ââWhat about the
/posts/<id>(read) page? It still goes to Django. BUT, the old Django code (querying comments from DB) will be changed to: make an API call to the FastAPI service (port 8001) to get the comments. This is Part 4a - The Live Demo.â
Slide 21: Lab - Guide (Demo & Hands-on)
Content:
PART 4A: LIVE DEMO (TRAINER-LED)
Trainer sets up Nginx as a Proxy for Django.
Trainer builds the
Comment Service(FastAPI + private DB).
Trainer configures Nginx
location /api/comments/ { ... }to redirect.
Trainer refactors the Django
views.py(usingrequeststo call the API).
PART 4B: STUDENT LAB (YOUR TURN!)
Mission: Strangle the âReviewsâ service.
Given: An
E-commerceMonolith (Django) managingProductsandReviews.Task: Split
Reviewsinto an independent FastAPI service (similar to the Demo).
Visualization:
Split into 2 columns: âDemoâ (Trainer) and âLabâ (Student).
âDemoâ column has a checklist of steps.
âLabâ column has the new problem description.
Instructor Script:
âI will now demo these 4 steps (Part 4a). Please do not code along. Instead, observe âwhyâ I am doing what Iâm doing, especially the Nginx config file and how I change the Django view.â
â⊠[PERFORM LIVE DEMO] âŠâ
âOkay, youâve seen how itâs done. Now itâs your turn (Part 4b). You will receive an
E-commercecodebase (similar) and your mission is to strangle theReviewsservice.ââThis is your chance to apply 100% of what we just learned. You have 60 minutes. Myself and the TAs will be here to help.â
Slide 22: Part 5 - Optimization & Critique
Content:
PART 5
OPTIMIZATION & CRITIQUE
Best Practices & When NOT to use them
Visualization:
Title slide.
An image of a crossroads, with a green light (Best Practices) and a red light (Anti-Patterns).
Instructor Script:
âYou all did great on the lab. Now for the âadvancedâ section. This is the âhard-wonâ experience that takes you from âmaking it workâ to âmaking it rightâ.â
âAnd more importantly, with âCritical Thinkingâ, we will learn when to say âNOâ to microservices.â
Slide 23: Best Practices (The âDoâsâ)
Content:
THE GOLDEN RULES (BEST PRACTICES)
1. âNotâ too small:
âNano-servicesâ (e.g.,
CreateUserservice) are an anti-pattern.Start with larger services (by Bounded Context). Itâs easier to split than to merge.
2. Prefer Asynchronous:
Avoid synchronous API chains (A -> B -> C). If C fails, A & B fail.
Use a Message Queue (Events) to âdecoupleâ services.
3. Design for Observability:
The 3 Pillars: Logging (ELK), Metrics (Prometheus), Tracing (Jaeger).
Without these, you are âblindâ when debugging.
4. Conwayâs Law:
âAn applicationâs architecture will mirror the organizationâs communication structure.â
Want Microservices? Organize into small, autonomous âsquadsâ.
Visualization:
A 4-quadrant layout, each with a Best Practice and icon:
[Icon: Magnifying glass (not too small)]
[Icon: Queue]
[Icon: Dashboard]
[Icon: Org chart/Team]
Instructor Script:
âHere are the 4 rules. One: Donât split services so small they become ânanoâ.
CreateUserandGetUserservices should be in the same âIdentityâ Bounded Context. Remember: âSplittingâ one large service into two is EASY. âMergingâ 10 nano-services is a nightmare.ââTwo: Prefer asynchronous communication (like my âpublic speakerâ example). Avoid synchronous API calls as much as possible.â
âThree: [EMPHASIZE] You must have Observability. When 100 services are running, if you donât have centralized Logging and Tracing, one error will take you 3 days just to find which service caused it.â
âFour, Conwayâs Law: If your boss still structures teams as âFrontend Teamâ, âBackend Teamâ, âDBA Teamâ, you will 100% create another Monolith. To get Microservices, you must organize into âsquadsâ, where each squad owns 1-2 services (end-to-end).â
Slide 24: When NOT to use Microservices
Content:
CRITIQUE: WHEN TO SAY âNOâ?
Be an Engineer, not a âFanboyâ.
1. Very Early-stage Startups:
When your priority is Time-to-Market.
When the business domain is changing âwildlyâ every week.
=> A Monolith is much, much faster.
2. Small Team / Weak DevOps:
When you have 2 developers and no dedicated DevOps.
Microservices will become âOperational Hell.â
3. Unclear Domain:
When you donât even know what your Bounded Contexts are.
=> You will split it wrong, and the cost to fix it is higher than starting over.
Visualization:
A strong layout, using a large [Icon: Red light] or [Icon: Stop sign].
The slide background could be a light grey or warning red.
Instructor Script:
âThis is my most important slide today, and it demonstrates the âCritical Thinkingâ of an expert. Do not follow the âtrendâ.â
âNEVER use Microservices if you are a 3-person startup and your business logic is unclear. You need speed to market. Use a Monolith. Django/Rails were born for this!â
âNEVER use them if your team has no (or weak) DevOps. You will drown in operational overhead.â
âAnd finally, if you canât even âdrawâ your Bounded Context Map (like in Part 2), donât even think about splitting services. You will split it wrong. And it is better to have a good Monolith than a bad, âshatteredâ microservice architecture.â
Slide 25: Part 6 - Real-world Case Study
Content:
PART 6
REAL-WORLD CASE STUDY
Case Study: Uber
Visualization:
Title slide. The Uber logo.
Instructor Script:
âOkay, letâs see how a âgiantâ applied these exact principles. Uber.â
Slide 26: Case Study: Uber
Content:
CASE STUDY: UBER (FROM A PYTHON MONOLITH)
Context (Monolith):
Uber (2010) started as a Monolith written in Python (using a custom framework).
Everything in one codebase, one DB (PostgreSQL).
The Pain:
Couldnât scale when expanding to new cities.
Adding new features (UberEATS) to the Monolith was extremely risky.
A bug in
Paymentmodule -> brought down the entireFinding(ride-hailing) system.
The Action (The âStranglerâ):
They used the Strangler Fig Pattern (exactly as we just learned).
âBroke offâ
Billingfirst as a new service.The old Monolith, instead of processing payments, was changed to call the API of the new
Billingservice.
The Result:
Thousands of microservices (written in Go, Java, PythonâŠ).
Thousands of independent deployments per day.
AI Connection: Allowed them to âplug-inâ AI/ML services (like Dynamic Pricing) as independent services without breaking the rest of the app.
Visualization:
A âBeforeâ and âAfterâ diagram for Uber (simplified).
âBeforeâ: 1 block
Uber Monolith (Python).âAfterâ: with services like
Billing,Trip,Driver,Pricing (AI).Highlight the
Pricing (AI)service.
Instructor Script:
âUber started just like us, with a Python Monolith.â
âWhen they exploded in growth, they hit the exact 3 âpain pointsâ we discussed. Especially the Payment bug crashing the ride-hailing system.â
âAnd what did they do? They did not do a âBig Bang Rewriteâ. They used the âStrangler Fig Patternâ. They âstrangledâ the
Billingservice first. The old Monolith was refactored to call the API of the newBillingservice.ââThey repeated this hundreds of times, resulting in the architecture of thousands of services they have today.â
âAnd here is the key takeaway for my AI training goals: This architecture allows them to plug in âsmartâ services. The âDynamic Pricingâ service is an independent AI/ML service. It can be written in Python (for AI libraries), scaled separately (it needs GPUs), and have its models updated continuously, all without affecting the âRide-hailingâ service (written in Go). That is the power of microservices when done right.â
Slide 27: Part 7 - Assessment & Reinforcement
Content:
PART 7
ASSESSMENT & REINFORCEMENT
Visualization:
Title slide. [Icon: Test/Quiz]
Instructor Script:
âWeâve reached the end of our journey. Now itâs time to check what weâve âharvestedâ.â
Slide 28: Assessment (Quiz & Homework)
Content:
ASSESSMENT
1. Quiz (10 minutes):
Please access the iMocha / LMS.
Complete the 15-question multiple-choice quiz for Module 1.
(Goal: Reinforce theory, Bounded Context, Database per Service).
2. Homework:
Complete and submit the source code for Part 4b (Student Lab - Strangling the âReviewsâ service).
The TO will create a submission link on SharePoint/LMS.
Visualization:
Split into 2 columns: âQuizâ and âHomeworkâ.
âQuizâ: [Icon: Timer]
âHomeworkâ: [Icon: Submission/Upload]
Instructor Script:
âWe have two assessments. One, you will take a quick 10-minute quiz right now on iMocha to reinforce the theory.â
âTwo, your homework is to complete the Lab from Part 4b. This is the âproofâ that you can âdoâ (Objective #4). The TO team will send a submission link. I will be reviewing your code.â
Slide 29: Module 1 Summary & Q&A
Content:
MODULE 1 SUMMARY
Understand the âpainâ of Monoliths and the âtrade-offsâ of Microservices.
Always split services by Bounded Context (Business).
Always adhere to Database per Service (Technical).
Always use the Strangler Fig Pattern for migration (Strategic).
Always ask: âDo I really need Microservices right now?â
Q & A
Visualization:
5 key summary bullet points.
A large clear space for Q&A.
Instructor Script:
âHere are the 5 things I want you to âtake homeâ today. If you forget everything else, remember these 5 points. They summarize the mindset of an architect facing this problem.â
âThank you. We now have time for Q&A. Please, your questions.â
Slide 30: Thank You & Next Module
Content:
THANK YOU!
(Your Contact Information)
COMING UP (MODULE 2):
Module 2: Service Communication Patterns
(Sync, Async, API Gateway, Service Discovery, Saga PatternâŠ)
Visualization:
Professional layout.
A âteaserâ for Module 2, showing the connectivity of the learning path.
Instructor Script:
âThank you all for your active participation. In Module 1, we âsplitâ the services. In Module 2, we will learn how to âmake them talk to each otherâ effectively and safely, especially how to handle the âdata consistencyâ problem (Saga Pattern) that I promised.â
âHave a great and productive day!â