Hands-on microservices: design, build and run a microservices system using Python, Flask and Consul.
Implement service discovery, configuration, load balancing and observability.
Secure communication, manage state and scale services in realistic scenarios.
Gain practical experience via 70% coding labs with Docker and cloud-ready setups.
How this helps: understand trade-offs in real-world microservice architectures.
Who it’s for: designed for individuals with Python basics who want applied microservices skills.
Includes guided labs and an end-to-end project to consolidate learning.
Curriculum
Day 1 — Architecture & service design
- Microservices vs Monoliths: costs/benefits, when to split, organizational fit
- Domain‑Driven Design (DDD): bounded contexts, ubiquitous language, aggregates, anti‑corruption layer
- Service decomposition: data ownership, database‑per‑service, transactional boundaries
- Consistency: idempotency, retries, eventual consistency, SAGA (orchestration vs choreography) — overview
- Interfaces: REST vs gRPC (read‑only intro), API versioning, error models
- Cross‑cutting: 12‑Factor App, configuration, secrets, health/readiness checks
- Discovery: service registry & discovery with Consul; health checks and tags
- Lab 1: model the domain and split into services (catalog, orders, payments). Sketch APIs and events
Day 1 — Containerizing the skeleton
- Dockerfiles for Python: multi‑stage builds, slim images, non‑root users
- Docker Compose project layout; environment separation (dev/test)
- Lab 2: containerize catalog & orders, expose /health and /ready endpoints
Day 2 — Implementing services in Python/Flask with DI
- Flask patterns: app factory, Blueprints, request lifecycle, config (env & files)
- Dependency Injection options (lightweight patterns or dependency‑injector); repositories, gateways, service layer
- Validation and serialization with Pydantic/Marshmallow; error mapping to HTTP
- Resilience: timeouts, retries (tenacity), backoff & jitter; idempotency keys
- Service discovery in practice: Consul agent, sidecar registration, DNS vs HTTP API lookups
- Lab 3: wire services through Consul; implement orders→payments call with idempotency
Day 2 — Observability foundations
- Structured logging: JSON logs, correlation IDs (X‑Request‑ID), log levels
- Shipping logs to ELK: Logstash pipeline basics; index naming and retention in Elasticsearch; boards in Kibana
- Metrics: prometheus_client, RED/SUSE metrics (rate, errors, duration), process metrics
- Lab 4: enable JSON logs and /metrics; visualize request rate & latency
Day 3 — Full stack ops: ELK, Prometheus & Grafana
- Compose stack: Consul server + agents, services, Logstash, Elasticsearch, Kibana, Prometheus, Grafana
- Dashboards & alerts: Grafana panels for p50/p95 latency, error rate; basic alert rules (concepts)
- Security touches: secrets in env/Consul KV, JWT at the edge (sketch), TLS termination (reverse proxy optional)
- Lab 5: end‑to‑end run — bring the stack up, generate load, debug via Kibana and Grafana
Day 3 — Hardening & delivery
- Testing: unit/integration, contract testing (Pact — overview)
- Packaging & CI: pyproject.toml, wheels, image scan; GitHub Actions skeleton
- Operations checklists: readiness probes, budgets/SLO basics, rollbacks
- Lab 6: add a failing dependency, observe, roll back safely
Optional modules
Optional — Advanced patterns
- Event‑driven microservices with Kafka/RabbitMQ (overview)
- CQRS & SAGA deep dive; outbox/inbox patterns
- Service mesh/Consul Connect and mTLS (intro)
Course Day Structure
- Part 1: 09:00–10:30
- Break: 10:30–10:45
- Part 2: 10:45–12:15
- Lunch break: 12:15–13:15
- Part 3: 13:15–15:15
- Break: 15:15–15:30
- Part 4: 15:30–17:30