Difference between Future annotation and Batch apex

Future Annotation
Batch Apex
Future Annotation is used to separate methods that are to be executed asynchronously.
Batch Apex is used to separate tasks that are going to handle more records in background process. Batch Apex also runs asynchronously
If Future Annotation is not used in a web service callout, the thread will wait until the response comes and other processes will not be executed.
If Batch Apex is not used for handling bulk records, we will hit governor limits set by Salesforce.com.

No comments:

Post a Comment