Asynchronous Apex, in its various forms, is incredibly useful. By trading synchronous execution of your code for relaxed or reset governor limits, you can process massive numbers of records, call out to web services without holding up your users, and, as of the Spring '15 release, you can even write fault tolerant asynchronous callouts. Knowing when to use which type of Asynchronous Apex, however, can be difficult. With that in mind, here are some guidelines:
If you are manipulating more than 2000 records, use Batchable Apex.
While you can directly schedule Batchable Apex, it is almost always preferable to wrap the batch Apex execution in a scheduled class, as this provides much more flexibility regarding execution time and.
Use the
@future
annotation in situations where the method can be called and forgotten.Default to Queueable Apex for asynchronous code, manipulating less than 2000 records at a time.
Write and use a standard wrapper for Queueable Apex like the one...