function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VijayNiVijayNi 

bulk api difference of version 1.0 and 2.0

Hi Team,

can you help me in understanding the difference between bulk API version 1.0 and 2,0

Thanks,
Vijay.
Best Answer chosen by VijayNi
ANUTEJANUTEJ (Salesforce Developers) 
Hi Vijay, 

>> https://sfdconestop.blogspot.com/2019/04/bulk-api-v1v2.html

There are multiple updates that are present in the v2 additionally there are features that are not present in v1, I was able to find the above link that details them.

Additionally there is an article regarding the same:

>> https://developer.salesforce.com/blogs/2017/12/slim-new-bulk-api-v2.html

For quick reference I am pasting the details of comparison here from the above article:

Comparing Bulk API v1 and v2
First, to get a sense of how Bulk API v2 is going to make things easier for you, let’s compare the process of creating a set of records using Bulk API v1 versus Bulk API v2.

 With Bulk API v1, you’d need to write code to do the following steps:

1 Get an authenticated session ID, likely via a completely different API, such as the SOAP API.
2 Create a Bulk API v1 job.
3 Break up job data into batches. This can be a complex task and in many scenarios will involve:
3-a Break up data to fit within the Bulk API v1 batch size limit for records, and batch size limit for total size for a batch.
3-b Decide if you need to use special processing headers, like compression or PK Chunking.
3-c Minimize the amount of data post-processing actions (like triggers and Workflow rules) that might result in batch processing timeouts.
3-d After all of this, if it turns out your batches take too long to process, go through the process of determining the best way to organize your batches all over again.
4 Upload data in batches.
5 Verify the batches uploaded properly.
6 Close the job, which tells Salesforce to start processing the records.
7 Check the status of the job.
8 If the job completes with no errors, we’re done.
9 If the job completes but encountered errors during processing, iterate over each batch in the job, collect results of successful and failed records for the batch, determine why the records failed, and re-assemble the data to submit a new job as needed.

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.

All Answers

ANUTEJANUTEJ (Salesforce Developers) 
Hi Vijay, 

>> https://sfdconestop.blogspot.com/2019/04/bulk-api-v1v2.html

There are multiple updates that are present in the v2 additionally there are features that are not present in v1, I was able to find the above link that details them.

Additionally there is an article regarding the same:

>> https://developer.salesforce.com/blogs/2017/12/slim-new-bulk-api-v2.html

For quick reference I am pasting the details of comparison here from the above article:

Comparing Bulk API v1 and v2
First, to get a sense of how Bulk API v2 is going to make things easier for you, let’s compare the process of creating a set of records using Bulk API v1 versus Bulk API v2.

 With Bulk API v1, you’d need to write code to do the following steps:

1 Get an authenticated session ID, likely via a completely different API, such as the SOAP API.
2 Create a Bulk API v1 job.
3 Break up job data into batches. This can be a complex task and in many scenarios will involve:
3-a Break up data to fit within the Bulk API v1 batch size limit for records, and batch size limit for total size for a batch.
3-b Decide if you need to use special processing headers, like compression or PK Chunking.
3-c Minimize the amount of data post-processing actions (like triggers and Workflow rules) that might result in batch processing timeouts.
3-d After all of this, if it turns out your batches take too long to process, go through the process of determining the best way to organize your batches all over again.
4 Upload data in batches.
5 Verify the batches uploaded properly.
6 Close the job, which tells Salesforce to start processing the records.
7 Check the status of the job.
8 If the job completes with no errors, we’re done.
9 If the job completes but encountered errors during processing, iterate over each batch in the job, collect results of successful and failed records for the batch, determine why the records failed, and re-assemble the data to submit a new job as needed.

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.
This was selected as the best answer
Malika Pathak 9Malika Pathak 9
Hi,

-In Bulk API 2.0, Salesforce automatically chunks the data for your job into multiple internal batches to improve performance while processing the     job. So managing batches and job status is moved from user space to system space!
-In Bulk API 1.0 differently sized batches are counted equally against your org limits! as shown above.
-In Bulk API 2.0, limits are defined in terms of the number of records processed.
     
You can refer this article you will get more clear idea about the Version 1.0 and 2.0
https://mohan-chinnappan-n.medium.com/salesforce-bulk-api-2-0-95a7a81b9bb9#:~:text=How%20it%20is%20different%20from,user%20space%20to%20system%20space!