Batch Apex vs Queueable Apex: Which is better for processing 200k records under governor limits?
0 reputation · 03 Oct 2025, 14:17 UTC
Goal: Process 200,000 records efficiently while staying within Salesforce governor limits.
Constraints: Batch Apex can handle up to 50,000 records per batch and allows a configurable batchSize, but requires careful start/execute/finish handling to avoid CPU and heap limits. Queueable Apex limits each job to 200 records and the system to 50 queued jobs per 24‑hour period, yet offers a simpler recursive pattern for chaining jobs.
Uncertainty: Which approach scales more effectively for 200k records, how best to tune batchSize to avoid governor violations, and what impact does job chaining in Queueable Apex have on the 50‑job limit?
Specific questions:
- For a 200k record set, which approach scales better while staying within limits?
- How should
batchSizebe set in Batch Apex to avoid CPU and heap issues? - What is the impact of job chaining in Queueable Apex on the 50‑job limit?