Choosing the Right Async Tool
By the end of this lesson, you'll be able to:
- Apply a clear decision process for picking among @future, Queueable, Batch, and Scheduled Apex
- Justify a choice for a real scenario
- Recognize this as the same kind of decision process from Modules 16 and 29
Prerequisites: "Async Limits and Monitoring"
The decision process
- Does it need to run on a recurring schedule? → Scheduled Apex (often paired with Batch or Queueable inside it).
- Does it need to process a genuinely large number of records — more than a single transaction could reasonably handle? → Batch Apex.
- Does it need complex parameters (an sObject, a List, a custom class) or job chaining? → Queueable.
- Otherwise — a simple, one-off async task with only primitive parameters? →
@future, the simplest option.
Working through real scenarios
- "Sync a single Account to an external CRM after it\'s updated in a trigger." →
@future(simple, primitiveIdparameter, one-off). - "Recalculate a rollup across every Account in the org, nightly." → Scheduled Apex calling Batch Apex (recurring + large volume).
- "Process a List of Opportunities passed from a Visualforce/LWC action, then notify a second system." → Queueable (complex parameter, chaining).
- "Update every Contact\'s mailing address format, a one-time cleanup of 2 million records." → Batch Apex (a genuinely massive one-time volume, no recurrence needed).
The same shape of decision, once more
This is genuinely the same kind of decision as Module 16's List/Set/Map choice and Module 29's custom setting/metadata/object choice — a short, ordered set of questions, answered by what the actual requirement needs (recurrence, scale, parameter complexity), not by habit or whichever tool happens to be top of mind. Recognizing this recurring decision-making shape is itself a transferable skill, useful well beyond just this specific set of four tools.
Exercise
As a comment, choose the right async tool for: "process every Order placed today and send a single summary email once all are processed" — a one-time job for potentially thousands of records, no recurrence needed.
Show hint
Apply the decision process's second question.
Choosing the Right Async Tool Quiz
My Notes
Log in to keep private notes on this lesson.
Questions about this lesson
No questions yet — be the first to ask.
Log in to ask a question about this lesson.
Summary
This closing lesson turns "which async tool?" into a short, ordered decision process — mirroring the exact shape of Module 16's collection choice and Module 29's data-storage choice.