# What metrics and testing procedures validate the scalability of enterprise integrations under peak load volumes?

**Topic:** Integration · **Difficulty:** Medium · **Tags:** Integration, Scalability Testing, Performance Metrics

Read it on the site: https://www.forcechallenges.com/interview-questions/what-metrics-and-testing-procedures-validate-the-scalability-of-enterprise-integrations-under-peak-load

## Answer

**Basics:** Integrations fail at peak, not on average days. Load testing simulates peak concurrent traffic to find bottlenecks before production. Salesforce has a performance testing policy: you must follow it, typically testing in a Full sandbox only, never production, and may need to notify or get approval from Salesforce (Scale Test tooling exists for some editions; verify current policy).

**How it works:**
1. Define targets from business volumes: peak requests per second, records per hour, acceptable p95/p99 latency, error budget.
2. Build the test with representative data volume and sharing/automation (a Full sandbox copy), including all triggers, flows and validation.
3. Ramp load (JMeter, k6, Gatling, or a middleware test harness), then hold a soak period and a spike.
4. Collect metrics from clients, middleware and Salesforce (limits, debug/ApexLog, Event Monitoring, Limits API).
5. Tune, repeat, and document limits and a rollback plan.

**Advanced / deep dive:** Salesforce-specific failure points: record lock contention (UNABLE_TO_LOCK_ROW) on parent skew or hot records; Apex CPU time and SOQL/DML limits from automation firing on bulk loads; the daily API request allocation and concurrent long-running request limits; Bulk API batch and record limits; async capacity (Queueable and Batch queue depth, 5 concurrent batch jobs); platform event publishing and delivery allocations; and sharing recalculation after large loads. Design for resilience: retries with exponential backoff and jitter, circuit breakers, dead-letter handling and idempotency. Observe on both sides: end-to-end correlation IDs, middleware queue depth, and error categories. Test failure modes too (Salesforce maintenance, slow downstream) rather than only happy-path throughput.

**Code / config example:**
```apex
// Log how close you are to org limits during a test run
for (System.OrgLimit l : System.OrgLimits.getMap().values()) {
    if (l.getName() == 'DailyApiRequests' || l.getName() == 'DailyBulkV2QueryJobs') {
        System.debug(l.getName() + ': ' + l.getValue() + ' / ' + l.getLimit());
    }
}
// REST equivalent: GET /services/data/vXX.0/limits
```

**Hidden gotchas & must-remember points:**
- Never load test production; follow Salesforce's performance testing policy and notify as required.
- Sandbox performance differs from production, so treat results as indicative.
- Row locks and data skew often fail before raw API limits do.
- Synchronous automation on integration objects can dominate cost; test with automation on.
- Test failure and recovery, not only success.
- Event allocation and daily API limits are per org per 24 hours; test the sustained, not just peak, volume.

**Best practice:** Set numeric SLOs first, test with production-like data and automation, and automate the same test as a regression before major releases.

---
Source: ForceChallenges · last updated 2026-11-02
