EmmEEdu
Distributed Systems & System Design

Software Architecture Patterns

From Modular Monoliths and Microservices to Event-Driven Pipelines, Serverless Edge, and Hexagonal Clean Architecture. Understand the trade-offs, boundaries, and failure modes.

Architectural Paradigm

Microservices Architecture

Loosely coupled, independently deployable bounded-context services

Production:NetflixUberAmazonSpotify

An architectural style that structures an application as a collection of services that are highly maintainable, testable, loosely coupled, independently deployable, and organized around business capabilities.

Component Boundaries & Protocol Wire Mesh
Web / Mobile ClientClient

Browsers and native mobile devices initiating user actions.

Protocol: HTTPS / WSS
API GatewayGateway

Handles authentication, rate limiting, SSL termination, and request routing.

Protocol: HTTP/2, TLS 1.3
Auth ServiceMicroservice

Issues JWTs, handles OAuth 2.0, manages user identity.

Protocol: gRPC / REST
Order ServiceMicroservice

Processes checkouts, manages shopping carts, calculates taxes.

Protocol: gRPC / Kafka
Payment ServiceMicroservice

Integrates with Stripe, manages fraud detection and settlements.

Protocol: gRPC / Event Queue
Orders DatabaseDatabase

Dedicated PostgreSQL database per microservice.

Protocol: PostgreSQL Wire
Event Bus (Kafka)Message Broker

Asynchronous publish-subscribe event backbone for decoupling.

Protocol: Kafka Protocol
Architectural Strengths
  • •Independent deployments without deploying whole monolith
  • •Fault isolation: failure in one service doesn't crash others
  • •Technological freedom per service
Trade-offs & Operational Costs
  • •High distributed operational complexity (service meshes, distributed tracing)
  • •Eventual consistency and complex distributed transactions (Saga pattern)
  • •Network latency overhead between internal services
Recommended Engineering Use Cases:
✓Large enterprise organizations with dozens of autonomous engineering teams
✓Applications with heterogeneous scaling requirements (e.g. video processing vs user auth)
✓Polyglot stacks where different services benefit from specialized languages (Python for AI, Go for networking)