MRavindran
MRavindran

Reputation: 467

Upsert Bulk vs Batch Upsert in Salesforce

I am trying to upsert large amount of data into Salesforce. I found there are two methods available for this. 1. Use UpsertBulk. This will upsert data in a single shot 2. Use Batching Create upsert job. create batches for upsert operation.

What is the difference between these two methods? What is the best way to do bulk upsert?

Upvotes: 1

Views: 4792

Answers (2)

marcin
marcin

Reputation: 136

Both methods are using Bulk API

Differences:

  1. Upsert bulk - single operation offered by Salesforce connector which creates a new Job in Salesforce and creates a Batch within the Job. After batch is processed you need to make sure Job will be closed.
  2. Create Job -> Create Batch - two separate operations of the Salesforce connector to create a new Job and add a new Batch within the Job. After batch(es) is processed you need to make sure Job will be closed.

Both options are pretty similar. Which one is better for you? I would check the Bulk API limits first and then decide -> Salesforce Bulk API Limits

Depending on the volume of data you are going to process you may want to create one or multiple batches (or maybe use multiple jobs).

Upvotes: 1

Matthijs
Matthijs

Reputation: 28

The best way to insert/update/upsert data in bulk is via the recently released and renewed BulkAPIv2. Please see this link: https://resources.docs.salesforce.com/210/latest/en-us/sfdc/pdf/api_bulk_v2.pdf

Bulk API 2.0 simplifies uploading large amounts of data by breaking the data into batches automatically. All you have to do is upload a CSV file with your record data and check back when the results are ready

Upvotes: 1

Related Questions