2

I need to insert/update/delete a variable number of records at a time from a webapp (so from javascript), are there reasons to choose the Salesforce Bulk API over writing a custom Apex REST class to do this or vice versa?

3

If the number of records is relatively small (10s or 100s) then a custom Apex REST method will be much simpler than using the Bulk API. The Bulk API is intended for asynchronous processing of thousands of records.

0

If you need to update a LOT of records (10's of thousands) the BULK API is the best method to do so.

For updates < 5-10k, the best method is the SObject Composite Collections that were added in v42. There are two major benefits over the existing composite tree & batch endpoints.

1: You can update up to 200 records at a time

2: The updates take place in a single execution context on salesforce. The other composite record create a context PER RECORD, which make it run incredibly slow for big updates.

-1

Bulk API is an implementation or REST API. So whether you use Bulk API or simply the REST based API depends on your client application ( your webapp ).

The advantage of Bulk API is to dump a large batch of records to Salesforce and let it process it. This will reduce the processing and iterations you would need to do in your app.

If you use standard REST API, you would need to loop through and submit records one by one.

  • Question asks about custom Apex REST class, not standard REST API. – metadaddy Jun 16 '14 at 21:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.