You are using an older browser that might negatively affect how this site is displayed. Please update to a modern browser to have a better experience. Sorry for the inconvenience!

HyperBatch for Salesforce

By: Radha


HyperBatch is a tool used to process large amount of records. It is an alternative to batch classes in Salesforce. Using this tool, we can perform all DML operations which can be accomplished by batch classes. The Hyperbatch gives a significant performance improvement compare to batch classes, but it needs to run from an UI and can’t be scheduled to run.


Suppose we have a requirement to create three contact records for 150k Account records.

What are the ways to meet the above requirement?

The first solution is using a Batch class in Salesforce.

Drawbacks of batch class:

Here, we cannot perform the operation on synchronization mode.

Batch class takes longer time to process the number of records compared to Hyperbatch.

Retry logic can be built when there is a failure, but it will likely exceed the transaction limits.

Efficient way to do the above process: 

The above drawbacks can be overcome by HyperBatch.

Hyperbatch Traditional Batch
User interfaceYes (required)No
Invoking another BatchNoYes
AsynchronousYes (5 running per organization)Yes (Not subject to 50 job per transaction limit (each request can be considered as a new transaction))
Row lock behaviorRow locks retry automatically until the transaction succeeds. Each re-attempt gets a new context


Default is a failed batch execution. Retry logic can be built, but it will likely exceed the transaction limits.


Creating Contacts: Traditional batch class vs Hyperbatch

Time taken to crate 1166 contacts.

Traditional batch class: 


 Hyperbatch class: 

hyperbatchDeleting contacts: traditional batch class vs HyperBatch

Time taken to delete 1739 contacts.

Traditional batch: 




Updating accounts: batch class vs HyperBatch.

Time taken to update 22 accounts.

Traditional batch class: 




OperationDatabase.batchable (in seconds)Hyperbatch

(in seconds)


(in seconds)

Create contact16106
Delete contact1798
Update account211

How does HyperBatch work?

  • HyperBatch interface can work like how Database.Batchableinterface does.
  • Browser perfectly works on selecting jobs as well as running them on-demand.
  • AJAX toolkit for PK chunking the query locator.
  • Each execute can return some state of type Object, it can be anything.


  • Parallel remote actions call the queueables for the batch executions methods. (Not serial!)
  • JavaScript polls for the status of the queueables, waiting for them to complete.
  • Execute state is stored in a custom object, and a list of them is returned to the finish() method, then they are deleted.


  • Parallel remote actions fire the synchronous transactions. (Not serial!)
  • Execute state is returned synchronously and stored in JavaScript in the browser until they are all complete.

Hyperbatch Resources: