Shift-left performance engineering: memasukkan performa sejak design phase, Non-Functional Requirements, performance-as-code, architecture performance review, dan mengubah budaya dari "test performa nanti" menjadi "desain untuk performa".

Setelah di episode 20 kita memahami SLO dan error budgets, kini saatnya membahas transformasi paling fundamental dalam performance engineering: shift-left. Shift-left berarti memasukkan pertimbangan performa sejak awal siklus pengembangan — saat design, requirement gathering, dan coding — bukan menunggu sampai testing akhir.
Di dunia modern, performance testing batch sebelum release sudah tidak cukup. Performance engineering yang efektif harus terintegrasi di seluruh lifecycle — dari product requirements sampai production monitoring. Episode ini membawa kalian memahami bagaimana mewujudkan shift-left performance.
Non-Functional Requirements mendefinisikan bagaimana sistem harus bekerja, bukan apa yang harus dilakukan. Performance adalah salah satu NFR yang paling kritis.
NFR-PERF-001: Response Time
- GET /products: p95 ≤ 200ms
- POST /checkout: p95 ≤ 500ms
- Search: p95 ≤ 300ms
NFR-PERF-002: Throughput
- API endpoints: ≥ 1000 RPS sustained
- Database queries: ≥ 500 QPS
NFR-PERF-003: Scalability
- Horizontal scaling dari 3 ke 20 instances dalam 2 menit
- Linear throughput scaling sampai 10 instances
NFR-PERF-004: Resource Usage
- CPU utilization ≤ 70% di bawah peak load
- Memory usage ≤ 80% di bawah peak loadAs a performance engineer,
I want the product listing API to respond within 200ms at p95
So that users can browse products without perceived delay.
Acceptance Criteria:
- p95 latency ≤ 200ms for 100 concurrent users
- Throughput ≥ 500 RPS
- Error rate ≤ 0.1%Performance-as-code adalah pendekatan yang mendefinisikan performance requirements, test scripts, dan thresholds sebagai code yang bisa di-version control, di-review, dan diotomasi.
// performance-requirements.js
export const SLO = {
availability: 0.999,
latency: {
'GET /products': { p95: 200, p99: 500 },
'POST /checkout': { p95: 500, p99: 1000 },
},
throughput: {
min: 1000, // RPS
},
};
// Performance test scripts
export const options = {
thresholds: {
'http_req_duration{endpoint:products}': [`p(95)<${SLO.latency['GET /products'].p95}`],
'http_req_duration{endpoint:checkout}': [`p(95)<${SLO.latency['POST /checkout'].p95}`],
},
};Performance considerations harus menjadi bagian dari code review:
Architecture performance review adalah sessi di mana performance engineer meninjau arsitektur sistem sebelum implementasi — mengidentifikasi potential bottleneck dan rekomendasi desain.
□ Database design
- Schema untuk query patterns?
- Index untuk frequent queries?
- Connection pooling strategy?
□ Caching strategy
- Apa yang di-cache?
- Cache invalidation strategy?
- Cache sizing?
□ API design
- Payload size optimized?
- Pagination implemented?
- Batch operations supported?
□ Scalability design
- Stateless services?
- Horizontal scaling supported?
- Load balancer configuration?
□ Resource management
- Thread/connection pool sizing?
- Memory limits configured?
- Timeout settings?Di episode 21 ini kalian telah memahami performance engineering (shift-left):
Di episode 22 selanjutnya, kita akan membahas Continuous Performance — bagaimana membangun sistem performance testing yang berkelanjutan, baseline management, dan trend analysis. Siapkan trend dashboard kalian!