Apa itu SRE?
Site Reliability Engineering adalah disiplin yang menggabungkan software engineering dan operations. Diciptakan oleh Google untuk memastikan sistem berjalan reliabel di skala besar.
SLI, SLO, dan SLA
- SLI (Service Level Indicator) — Metrik terukur. Contoh: "99.5% request berhasil dalam 200ms"
- SLO (Service Level Objective) — Target internal. Contoh: "Availability 99.9% per bulan"
- SLA (Service Level Agreement) — Kontrak dengan customer. Contoh: "99.5% uptime, jika gagal refund 10%"
Error Budget
Error budget adalah jumlah downtime atau error yang masih "diizinkan" berdasarkan SLO. Selama error budget belum habis, tim boleh mengambil risiko dengan merilis fitur baru.
SLO: 99.9% availability per bulan (30 hari)
Error budget = 100% - 99.9% = 0.1%
= 0.001 × 30 × 24 × 60 = 43.2 menit downtime per bulan
Jika error budget habis:
→ Stop feature release
→ Fokus perbaikan reliability
→ Baru lanjut develop setelah budget pulih
Toil Reduction
Toil adalah pekerjaan manual, repetitif, yang bisa diotomasi:
- Manual deployment → Otomasi CI/CD
- Manual scaling → Auto-scaling
- Manual certificate renewal → Certbot auto-renew
- Manual incident response → Runbook automation
Post-Mortem (Blameless)
## Incident Post-Mortem: Database Outage 2024-01-15
**Duration**: 23 minutes (14:05 - 14:28)
**Impact**: 100% API requests failed
**Severity**: SEV1
**Timeline**:
- 14:05 - Alert: Database connection pool exhausted
- 14:08 - On-call engineer acknowledged
- 14:15 - Root cause identified: N+1 query in new feature
- 14:25 - Hotfix deployed, connections recovering
- 14:28 - All systems normal
**Root Cause**: New API endpoint had N+1 query, each request opened 50+ connections
**Action Items**:
- [ ] Add query count limit middleware
- [ ] Add connection pool monitoring alert
- [ ] Add N+1 detection in CI pipeline