0

I'm writing a software in C# that need to pull all the information about 100,000 users in Salesforce (Id, Username, all other attributes).

I think to use Bulk API for that, it's the best option for my task? Do i need to enable the PK Chunking option?

  • 2
    You don't need pk chunking for 100k records. Also, keep in mind that the bulk api processes as the system is available and there is no SLI for job turnaround times. With such a small set of records I would just use the standard rest or soap API. – Jesse Milburn Aug 15 '16 at 17:21
  • But I'll use more API calls in Rest\Soap API (1 for bulk and 50 for rest\soap). About the turnaround times in Bulk api, could you give me a link with explanation about it? – user34147 Aug 16 '16 at 5:38
  • 1
    50 API calls is nothing. There is nothing I found documented that talks about the actual turn around times, but this article mentions that they get queued into jobs. developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/…. I have used bulk API a lot, and the job start times normally aren't too long after you upload the request. So as long as you don't need the data up or down asap it is fine to use. Keep in mind that the format is different as well so you won't just be sending SObjects, you will have to put them in a consumable format. – Jesse Milburn Aug 16 '16 at 11:58
1

You can run an extract using data loader via the CLI, and then manipluate the CSV. You may automate it further using powershell, etc.

https://developer.salesforce.com/page/Using_Data_Loader_from_the_command_line

We use this for processing records (~1.5 mil daily) out of salesforce before feeding the records into some older applications. Data Loader has been reliable thus far.

1

PK Chunking's minimum batch size is 100,000; since that's all you're trying to query, it won't help you. Using the bulk API will reduce your API usage, and will probably be more efficient than using the SOAP API, which will use at least 50 API calls, and may use many more. If you decide to use the SOAP API, remember to set the QueryOptions header to request 2,000 records per API call. There's a similar header in the REST API's Query Options Header.

  • Just want to be sure that i got your answer: I need to use PK Chuncking in case that my query return more then 250,000 records. For 100,000 records - bulk api will use 1 api call and rest\soap will use al least 50. – user34147 Aug 16 '16 at 5:42
  • @user34147 That''s about the size of it. Using the bulk API does grant some advantages. Of course, the maximum file size has some effect, but you there's no need for PK chunking in normal cases. – sfdcfox Aug 16 '16 at 5:51
  • Thank you, and what about the processing time of bulk api (see @Jesse Milburn comment above), i want to write a synchronous function that use this api, there is a time limitation for the processing time? – user34147 Aug 16 '16 at 6:00
  • @user34147 the bulk API has a limits document, but to sum it up, 15 attempts with a maximum limit of 10 minutes per attempt. So it shouldn't be more than 150 minutes at most. A query that small will probably run in just a few minutes though. – sfdcfox Aug 16 '16 at 13:34

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.