7. Why Asynchronous Apex
1. For higher Governor limits
2. Mixed DML operation
3. Long Running job
4. Make a callout from Trigger
8. Governors Limits
Description Synchronous Limit Asynchronous Limit
Total number of SOQL queries issued 100 200
Total heap size 6 MB 12 MB
Maximum CPU time on the Salesforce servers5 10,000 milliseconds 60,000 milliseconds
9. Different Way of Asynchronous Apex
Future Method Queueable Apex Batch Job Scheduled Apex
10. Future Vs Queueable
Future
1. Easy to implements
2. Only accept primitive type
arguments (Integer, String ,
etc, Collection of primitive)
3. Can’t chain jobs
4. Hard to monitor
Queueable
1. Need to create one apex class
2. Support sObject
3. Ability to chain jobs
4. Can be monitored