Microservices

Microservices

1. Foundations

  • Monolith vs Microservices — when to split, when not to
  • Service boundaries — Domain-Driven Design, bounded contexts
  • Database per service vs shared database anti-pattern
  • Synchronous (REST/gRPC) vs Asynchronous (event-driven) communication

2. Communication Patterns

  • API Gateway pattern (routing, auth, rate limiting)
  • Service-to-service calls — REST, gRPC, GraphQL federation
  • Event-driven architecture — pub/sub, message brokers (Kafka, SQS/SNS)
  • Choreography vs Orchestration

3. Data Management

  • Saga pattern (orchestration-based vs choreography-based)
  • Outbox pattern — reliable event publishing
  • CQRS (Command Query Responsibility Segregation)
  • Event Sourcing
  • Distributed transactions — why 2PC fails at scale

4. Resilience & Reliability

  • Circuit Breaker pattern (Resilience4j, Hystrix legacy)
  • Retry with exponential backoff + jitter
  • Bulkhead pattern — isolating failure domains
  • Timeout strategies
  • Idempotency — designing idempotent APIs/consumers
  • Rate limiting & throttling

5. Service Discovery & Routing

  • Client-side vs server-side discovery
  • Service mesh (Istio, Linkerd) — what it solves vs API gateway
  • Sidecar pattern

6. Observability

  • Distributed tracing (OpenTelemetry, Jaeger, X-Ray)
  • Centralized logging (correlation IDs across services)
  • Metrics & SLO/SLA monitoring
  • Health checks — liveness vs readiness probes

7. Deployment & Infrastructure

  • Containerization (Docker) + Orchestration (Kubernetes)
  • Blue-Green, Canary, Rolling deployments
  • Strangler Fig pattern — migrating monolith to microservices
  • Infrastructure as Code for microservices environments

8. Security

  • Zero-trust between services — mTLS
  • OAuth2/OIDC in a microservices context
  • Secrets management
  • API security at the gateway layer

9. Architecture Patterns at Scale

  • Backend for Frontend (BFF)
  • Strangler Fig (migration strategy)
  • Anti-corruption layer
  • Sidecar/Ambassador patterns
  • Multi-tenancy strategies

10. Interview/Architect-Level Topics

  • CAP theorem and PACELC in practice
  • Consensus algorithms (Raft/Paxos) — where they show up (Kafka, etcd)
  • Trade-offs: consistency vs availability in real systems
  • “Design a microservices system for X” — case study format