Asynchronous Processing at Scale: Queueable vs. Batchable vs. Future Methods in Salesforce & OmniStudio Architecture

Master asynchronous processing in Salesforce. Compare Queueable, Batchable, and Future methods to architect high-performance solutions that handle millions of records without hitting concurrency or Governor Limits.

André Rödel

5/26/20263 min read

Asynchronous Processing at Scale: Breaking the Concurrency Barrier

Processing data at scale in Salesforce is a delicate balancing act. Whether you are synchronizing millions of records with an external ERP or executing heavy calculations behind the scenes of an OmniStudio orchestration, you are always operating under the strict supervision of Governor Limits.

When transaction volumes spike, synchronous execution becomes your worst enemy. It leads to CPU time-outs, degraded user experiences, and the dreaded Too many SOQL queries exceptions.

To build a truly resilient architecture, you must master the asynchronous tools at your disposal: Future Methods, Batchable Apex, and Queueable Apex. But knowing how to write them isn't enough; an Architect needs to know exactly when to use which.

Let’s break down how to handle massive scale without getting crushed by concurrency limits.

1. Future Methods (@future): The Legacy Quick Fix

Future methods were the original way to run Apex asynchronously. They are incredibly easy to implement, just add an annotation, but they come with severe architectural restrictions.

  • The Good: Perfect for simple, isolated tasks like making a quick web callout after a record update, or bypassing the "Mixed DML" error when updating Setup and non-Setup objects in the same transaction.

  • The Bad: You can only pass primitive data types (Strings, IDs, Integers). You cannot pass sObjects.

  • The Architect’s Warning: Future methods cannot be chained, and you cannot monitor them easily. If you fire hundreds of future methods from a Trigger during a mass data load, you will immediately hit the Limit Exception: Too many future calls.

Verdict: Use them sparingly. They are a utility knife, not an enterprise scaling tool.

2. Batchable Apex: The Heavyweight Champion

When you need to process millions of records, Batch Apex is your only real option. It is specifically designed to query massive datasets and break them down into manageable chunks.

  • How it works: You use a Database.QueryLocator that can retrieve up to 50 million records. The platform then processes these records in chunks (up to 200 at a time), giving each chunk a fresh set of Governor Limits.

  • Concurrency Management: Salesforce allows up to 5 Batch jobs to run concurrently. If you submit more, they are placed in the Apex Flex Queue (which can hold up to 100 jobs in a "Holding" state).

  • The Drawback: Batch Apex is slow to start. It is not meant for near-real-time processing. It is an asynchronous bulldozer meant for nightly ETL tasks, data cleansing, and massive scheduled recalculations.

3. Queueable Apex: The Modern Engine

Introduced as a massive upgrade over Future methods, Queueable Apex combines the simplicity of @future with the power of Batchable. It is the gold standard for complex, near-real-time integrations and processing.

  • The Good: Unlike Future methods, Queueables allow you to pass complex types (like Lists of sObjects or custom wrapper classes). You get a Job ID back, meaning you can monitor the execution in the AsyncApexJob table.

  • The Superpower (Chaining): You can chain Queueables together. If Job A finishes, it can enqueue Job B. This is incredibly useful for hitting external APIs sequentially or bypassing API timeout limits.

  • Transaction Finalizers: You can attach a Finalizer to a Queueable job to implement robust retry logic if the job fails due to an unhandled exception or limit breach.

Architectural Decision Matrix

How do you choose? Keep this cheat sheet in mind:

  1. Do you have millions of records to process on a schedule? → Use Batchable. Let the QueryLocator handle the heavy lifting.

  2. Do you need to process a dynamic list of records right now and maybe chain another process afterward? → Use Queueable. It is faster to initialize than Batch and handles complex data gracefully.

  3. Do you just need to bypass a Mixed DML error with a single line of code? → Use Future. But do not use it inside a loop.

Final Verdict

Scaling in Salesforce is not about writing code that runs fast once; it is about writing code that respects boundaries when the system is under intense load. By leveraging the Apex Flex Queue and pushing heavy processing to Queueables and Batches, you ensure that your core transaction logic remains simple, direct, and clean.

Connect

Reach out for feedback or technical inquiries.

Email

© 2026. All rights reserved.