All Levels90 min read· Topic 12.6

Developer and platform systems

CI/CD pipeline, deployment system, API gateway, metrics system, logging system, feature flags

⚙️Key Takeaways

  • 1
    CI/CD: pipeline stages (build → test → deploy) with artifact caching, parallel test execution, rollback capability
  • 2
    API Gateway: rate limiting, auth, request transformation, circuit breaking — Kong, AWS API Gateway, Envoy
  • 3
    Metrics system: time-series database (Prometheus, InfluxDB) + dashboarding (Grafana) + alerting
  • 4
    Feature flags: enable/disable features per user/region without deployment — LaunchDarkly, Unleash architecture

Building Developer Infrastructure

Developer platform systems are the tools that every other system depends on: CI/CD, monitoring, logging, feature management, and API infrastructure. Designing these well multiplies the productivity of every engineering team.

System Breakdowns

Trigger: Git push → webhook → pipeline scheduler.

Stages: Checkout → Install dependencies (cached) → Lint → Unit tests (parallelized) → Build → Integration tests → Deploy to staging → Smoke tests → Deploy to production.

Artifact management: build artifacts stored in registry (Docker Registry, Artifactory). Cached layers for speed.

Rollback: keep N previous deployments ready. Blue/green or canary for safe production deployment.

Collection: Prometheus scrapes metrics from services every 15-30 seconds. Or services push to StatsD/OTLP collector.

Storage: time-series database (Prometheus TSDB, InfluxDB, Thanos for long-term).

Dashboarding: Grafana builds real-time dashboards with queries (PromQL).

Alerting: define thresholds (p99 > 500ms for 5 min → page on-call). Route via PagerDuty, Opsgenie.

Core: key-value store mapping feature flag name → rules (enable for 10% of users, enable for beta testers, enable in US only).

Architecture: flag management UI → API → rules engine → distributed cache (Redis) → SDK in each service evaluates flags locally.

Evaluation: SDK downloads rules, evaluates locally (no network call per check). Updates via streaming (SSE) or polling.

Use cases: gradual rollout (1% → 10% → 50% → 100%), kill switch (instant disable), A/B testing, trunk-based development.

Advantages

  • CI/CD automates the entire deployment lifecycle
  • Time-series DBs efficiently store metrics data
  • Feature flags decouple deployment from release

Disadvantages

  • CI/CD pipelines require significant investment to build well
  • Metrics cardinality explosion increases storage costs
  • Stale feature flags become technical debt

🧪 Test Your Understanding

Knowledge Check1/1

Why are feature flags evaluated locally in the service rather than via API call?