When folk say “use the salesforce.com API” I usually respond with “which one?” There are at least 3! We’ve just published an article on one of those other ones – the Force.com Bulk API.
The article is Loading Large Data Sets with the Force.com Bulk API and it comes with a sweet code sample as well. If you’re doing anything with Force.com (and that includes Salesforce CRM), and you’re playing with lots of data, then check it out. Oh, and here’s a factoid: the API is REST based!
Here’s the abstract:
Loading very large sets of data is becoming a common task for implementations, integrations and ongoing support. The standard Force.com Web Services API requires developers and administrators to implement complex processes to upload data in bite-sized chunks, monitor results and retry failed records. This method is acceptable for small loads of data but becomes unwieldy and time-consuming with large data sets that sometimes require numerous man-hours and multiple computers to operate in tandem.
The new Force.com Bulk API was designed specifically to offload the complex and time consuming process of importing large data sets from your client application to the Force.com platform. The Bulk API and supporting web interface allows you to upload and create import jobs, monitor and manage these jobs through an easy to use web interface, and receive notifications when the jobs complete. A few client applications already support the Bulk API but we’ll develop our own Java command line application that uses the Bulk API to upload large sets of data from a CSV file and database. This application can then be used as a starter for your own custom bulk data loader.