Edocti
Advanced Technical Training for the Software Engineer of Tomorrow
Edocti Training

Practical Microservices with Python, Flask & Consul

Intermediate
21 h
4.9 (609 reviews)

Scheduled sessions

No sessions are available at the moment.
Practical Microservices with Python, Flask & Consul

Hands-on microservices: Design, build, and run a robust microservices system using Python, Flask, and Consul.

Implement essential patterns like service discovery, configuration management, load balancing, and observability.

Learn to secure communication, manage state, and scale services effectively in realistic scenarios.

Gain practical experience through intensive coding labs (70% of the course) using Docker and cloud-ready setups.

How this helps: Understand the architectural trade-offs and operational realities of real-world microservice deployments.

Who it’s for: Individuals with a basic understanding of Python looking to acquire applied microservices skills.

The course culminates in an end-to-end project to consolidate your learning.

Skills You Will Learn

Python & Flask Docker Containers Consul & Service Discovery ELK Stack & Grafana Microservice Architecture Observability & Metrics Load Balancing State Management

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

Did you attend this course?

Your feedback is invaluable to us. Please share your experience with us and help us improve this course for future participants.

Share your feedback

Want to find out more? We are here to help!

Or email us directly at training@edocti.com.