Loading at Volume
Dette innholdet er ikke tilgjengelig på ditt språk.
Also in 19 languages
Español · 日本語 · Português (Brasil) · Français · Deutsch · Italiano · 한국어 · 简体中文 · Português (Portugal) · 繁體中文 · Bahasa Indonesia · Türkçe · Polski · Tiếng Việt · ไทย · Українська · Español (México) · Français (Canada) · Deutsch (Schweiz)

Module 2 of 5 in the chapter Migration and Synchronization, chapter 10 of the Data Architect course. Each module stands on its own. Previous: Migration Is a Quality Project First · Next: Automation During the Load
The question this module answers: How does the Number of Zeros change the way you load data into Salesforce?
Ten records? I can almost type them in. A thousand? Now I need a tool. A million? That’s an architecture problem. The operation hasn’t changed (create or update records), but the Number of Zeros changes how I do it. We’ve seen it with modeling, queries, sharing and integrations, and migration is no different. At volume I care about how I move the data, how I break it into work, what order it moves in, what else Salesforce is doing while I load, how I recover when something fails, and whether I can run the whole thing again.
Start With the Picture
Section titled “Start With the Picture”Same landscape, same amber arrow as module 1: RouteDesk’s open work coming into Salesforce the weekend RouteDesk retires.
Module 1 decided what moves on this arrow. This module is about how it moves.
Module 1 decided what comes in: the deliveries not yet made and the ones still inside the 60-day claim window, about 196,400 deliveries. Each one becomes a Work Order, with its line items (about 1.6 per delivery, so about 314,000) and its Service Appointment (about 196,400 more). That’s roughly 707,000 records, prepared in the preparation data store and ready to go. Not millions, but well past anything I’d send one record at a time. So, how do they get in?
The Loading Dock Behind the Bank
Section titled “The Loading Dock Behind the Bank”When I teach the Bulk API, I use the bank. You walk in with a stack of deposits, and the teller takes 200 and sends you to the back of the line. With a million records, that’s 5,000 trips through the line, 5,000 API calls. Meanwhile a truck pulls up to the side of the bank, unloads a massive amount of deposits, and twenty minutes later drives away while you’re still in line. That’s the loading dock, and its name is the Bulk API.
The 200 is still real. A REST sObject Collections request takes “up to 200 records” (Create Records Using sObject Collections (opens in a new tab), REST API Developer Guide), and a SOAP create() call the same: “If a create request exceeds 200 records, then the entire operation fails” (create() (opens in a new tab), SOAP API Developer Guide; both checked 2026-10-27). Every 200 more records is another call. RouteDesk’s 707,000 records would be over 3,500 trips to the teller.
Same records, different door.
The loading dock has five steps:
- Open the job. Hit the red buzzer and get a ticket: the job ID.
- Upload. The dock opens and you load your CSV files against that ticket, one file or a hundred.
- Close the job. Salesforce doesn’t know you’re done until you press the big blue button: upload complete. Now it starts processing.
- “Are we there yet?” Like my kids in the back seat: you ask, with your job ID, whether it’s done. Is it done? Is it done?
- Get the results. Download the successful records (with their new Salesforce IDs) or the failures (with their errors).
Submit, wait, collect.
A million records costs a handful of calls instead of thousands. But notice what changed: the work is asynchronous. You don’t get an answer per record; you submit, wait, and collect. So the caller needs to know what was submitted, what’s still processing, what completed, what failed and what came back. That’s not an API detail. That’s migration control.
Two Loading Docks: Bulk API 2.0 and Bulk API
Section titled “Two Loading Docks: Bulk API 2.0 and Bulk API”There are two versions, and it matters which you’re on.
- Bulk API 2.0 is the one to start with. You upload the data for a job and Salesforce splits it into batches for you, retries for you and runs them in parallel. A job can take 150 MB, measured after Salesforce encodes it, so Salesforce advises uploading no more than 100 MB of CSV per job.
- Bulk API (1.0) makes you create the batches yourself, up to 10,000 records each. It’s older, but it still has two levers 2.0 doesn’t give you: serial mode for loads, and PK chunking for very large exports (module 5).
Both share a rolling 24-hour allowance of 15,000 batches, and either can load up to 150 million records in 24 hours. Job results are kept for seven days after the job completes (Bulk API and Bulk API 2.0 Limits and Allocations (opens in a new tab), checked 2026-10-27). Salesforce’s line between the doors: “Any data operation that includes more than 2,000 records is a good candidate for Bulk API 2.0”; below that, “bulkified” synchronous calls are fine (Loading Data from the API (opens in a new tab), Best Practices for Deployments with Large Data Volumes, Winter ‘27, checked 2026-10-27). Those are today’s numbers: check them before you plan around them.
Singles, sets and bulk is how I think about the shape of the work: a single update from a user action, a few hundred related records from a business process, millions of historical records in a migration. Those aren’t product names. Ask what the shape of the work is before you choose the tool.
Test knowledge. Know when the Bulk API is the answer: more than about 2,000 records, asynchronous, a job you submit and collect. Know the two versions apart: Bulk API 2.0 splits the batches for you and runs them in parallel; Bulk API (1.0) has you build batches of up to 10,000 records, and only it offers serial mode and PK chunking. Both share 15,000 batches in a rolling 24 hours.
The Tool Doesn’t Eliminate the Architecture
Section titled “The Tool Doesn’t Eliminate the Architecture”“We’ll use the Bulk API.” Okay. That doesn’t tell me which objects load first, insert or upsert, what the external key is, how relationships are rebuilt, what happens when some records fail, whether jobs can run in parallel, whether parallel work will fight over the same parents, what automation will execute, or how we’ll reconcile and restart. The Bulk API solves a transportation problem. It doesn’t solve the migration.
The order comes from the model, and module 1 drew it for RouteDesk: reference data first, then the Work Orders, then their line items and appointments, then the claim Cases that point at them (Preserve the Source Identity, and Load by Keys). Each wave is its own job, and the next one doesn’t start until the last one’s results are in. Junction objects depend on two parents, self-referencing hierarchies may need several passes, and circular relationships may need records first and relationships second. Don’t discover these on cutover weekend.
Sometimes you load the record, then the relationship. A parent company, a subsidiary and a regional subsidiary are all created in the migration. Rather than resolving every relationship in one pass, load the accounts with their stable source keys, then run a second pass that sets the hierarchy. The same idea helps with self-lookups and circular dependencies. The goal isn’t one pass. It’s a deterministic, repeatable result.
Insert, Update or Upsert
Section titled “Insert, Update or Upsert”Insert says create this as new. Update says I already know the Salesforce record I’m changing. Upsert says use this key to find out whether the record exists; update it if it does, create it if it doesn’t. With stable External IDs, upsert makes rehearsals far easier: load, find a transformation problem, fix it, rerun, without the run assuming everything is a first-time insert. Keys are architecture, not just integration plumbing. RouteDesk’s Work Orders upsert on the partner key, the same field the integration uses, so a manifest Redrock resends on cutover weekend updates the migrated record instead of duplicating it.
Upsert has a price, though. Salesforce’s own Large Data Volumes guide ranks the operations: “insert() is fastest, update() is next, and upsert() is next after that. If possible, also break upsert() into two operations: create() and update()” (Loading Data from the API (opens in a new tab), checked 2026-10-27). How do you know which records are new and which already exist? The preparation data store knows, because it pulled down what Salesforce already has and keeps the IDs that came back (module 1). So the 190,000 delivered Work Orders that nothing in Salesforce has touched can go in as a plain insert, and only the open ones the integration may already have created need the upsert.
Two more lines from the same guide. Load clean data: “Errors in batches trigger single-row processing for that batch, and that processing heavily impacts performance.” That’s module 1 paying off at the loading dock. And when you update, “send only fields that have changed.” A reload that resends every field of 196,400 Work Orders does work nobody asked for.
But upsert isn’t magic. If the key strategy is wrong, the operation is wrong. Two source records for the same customer with different keys are two records to Salesforce; a source key that can identify several targets means we misunderstood the cardinality. Module 1’s quality work still matters; an API feature doesn’t replace it.
Test knowledge. Insert is the fastest operation, then update, then upsert; Salesforce suggests splitting an upsert into creates and updates where you can. Upsert needs an External ID, and it’s what makes reruns safe. Load clean data, because errors in a Bulk API batch push that batch into slow single-row processing, and send only the fields that changed.
Parallel Is Faster, Until It Isn’t
Section titled “Parallel Is Faster, Until It Isn’t”Parallel processing raises throughput. But if many records in the load point at the same parent, the transactions compete for locks on that parent, and the thing we did to go faster creates lock contention, errors and retries. That’s chapter 7’s hot spots again: if a million children converge on a few parents, the shape of the data matters to the load. When two batches each wait on a lock the other holds, you get a deadlock, two cars stuck at an intersection.
RouteDesk is exactly that shape. Almost 196,400 Work Orders, and nearly every one points at one of three Retail Partner Accounts. Load them in parallel in the order RouteDesk exported them, and every batch holds Work Orders for all three partners.
In export order, every batch needs every parent. One locks, the others wait.
Two levers. First, sort the files by parent, so the children of one parent travel together in the same batch instead of being spread across batches that collide. Salesforce gives the same advice: “When changing child records, group them by parent—group records by the field ParentId in the same batch to minimize locking conflicts” (Loading Data from the API (opens in a new tab), checked 2026-10-27).
Sorted by partner, each batch works on its own parent.
Second, on Bulk API 1.0, serial mode processes one batch at a time: slower, but it removes the contention. I reach for serial mode when the data is complex and we’re running into collisions and timeouts. Salesforce’s own guide is more cautious: serial mode “is used only when previously submitted asynchronous jobs have accidentally produced contention because of locks. Use only when advised by Salesforce” (Limits (opens in a new tab), Bulk API 2.0 and Bulk API Developer Guide, checked 2026-10-27). So sort first, and treat serial as the fallback. And it’s only on the older dock: Bulk API 2.0’s job reference says “Currently only parallel mode is supported,” and if other modes ever arrive, “the mode will be chosen automatically by the API and will not be user configurable” (Create a Job (opens in a new tab), Bulk API 2.0, checked 2026-10-27). A load that needs serial processing is a reason to use Bulk API 1.0.
Serial mode is a setting on the job, chosen when you create it. On Bulk API 1.0, RouteDesk’s Work Orders would be:
POST /services/async/68.0/job{ "operation": "upsert", "object": "WorkOrder", "externalIdFieldName": "Partner_Delivery_Key__c", "contentType": "CSV", "concurrencyMode": "Serial"}Leave concurrencyMode out and you get Parallel, the default. Salesforce’s job reference says when to change it: “If parallel mode results in too many failed records or failed jobs, submit the job with Serial concurrency mode,” and adds that it “can significantly increase the processing time” (JobInfo (opens in a new tab), Bulk API 2.0 and Bulk API Developer Guide, checked 2026-10-31).
And if three parents are too few for any sorting to help, look at the model. Checkpoint 1 already offered a way to spread them: link Work Orders to a child Account per distribution center, so nine parents share the load instead of three. That’s a design decision, made before the migration, not a loader setting.
I don’t start with “always parallel” or “always serial.” I look at the relationship shape, the hot parents, the automation that fires, what else locks, and what happened in rehearsal. Then I choose. Correct first, then fast.
Test knowledge. Parallel loads lock parent records. When many children share a few parents, expect “unable to lock row” errors: sort the load file by parent so each batch touches as few parents as possible. Serial mode (Bulk API 1.0 only) removes the contention at the cost of speed; Salesforce reserves it for lock contention the sorting didn’t solve.
Batch Size Is a Tuning Decision
Section titled “Batch Size Is a Tuning Decision”People want a magic number. I don’t have one. The right size depends on the object, the record complexity, the automation, the relationships, the locking, the payload and the mechanism. Too large, and failures get expensive and transactions do too much work; too small, and overhead dominates and the run takes far longer than it should (and on 1.0, burns your batch allowance). Start inside the tool’s supported limits, then measure against representative data.
And the rehearsal data needs the same shape as production. Twenty million records in production, ten thousand in the test, and everything flies: what did we prove? Not much about scale. The test doesn’t need every record, but it must expose the architecture: heavy concentration on a few parents, millions of children, large text fields, complex relationships, historical skew, automation triggered by particular values. The Number of Zeros matters, and so does the shape behind the zeros. For RouteDesk that means a rehearsal set where a third of the Work Orders still point at Redrock.
The Load User, and Who Owns the Records
Section titled “The Load User, and Who Owns the Records”For a substantial migration I want a dedicated migration identity, not someone’s personal admin account: for traceability, controlled permissions, automation decisions (module 3), monitoring and troubleshooting. A million records created by the migration user during cutover tells me something. A million created by Daniel Reyes because Daniel ran Data Loader on Saturday night mixes human identity with system activity. Give it the permissions the job needs, and don’t let it become a permanent mystery superuser nobody dares disable.
Then don’t confuse who loaded a record with who should own it. Created By is provenance; Owner is architecture, with sharing and business consequences. Set business ownership deliberately. Sometimes there’s no good answer in the source: the record’s owner left years ago, or never existed. It can be hard to assign records to active users, and I’ve created a dedicated “data load” user to own them. That’s sound practice with one condition from chapter 7: a user who owns more than 10,000 records of an object is ownership skew, so that owner should have no role, or a role of its own at the top of the hierarchy (Ownership Data Skew (opens in a new tab)), and the records should have a path to real owners. Who owns the records, and where that owner sits in the role hierarchy, is an important decision the team makes for any bulk import, not something the loader defaults. For RouteDesk’s Work Orders, chapter 7’s question decides it: does ownership drive who sees a delivery? At Steve Trucking it doesn’t (partners see their own deliveries through the partner on the record), so one owner with no role is fine.
Tools: Pick for Repeatability
Section titled “Tools: Pick for Repeatability”There are many ways to load data, and the tool matters less than how you use it. Salesforce’s Data Loader has been tried and true, but it’s aged: a desktop tool that works CSV by CSV. Its command-line version can be scripted and pointed at your preparation data store, which is how I’ve run repeated loads. Some tools connect a SQL database straight to Salesforce, copying data down and sending changes back with SQL. ETL and integration platforms do the same job at enterprise scale. And with the APIs you can drive the Bulk API directly: the Salesforce CLI’s sf data upsert bulk loads a CSV through Bulk API 2.0 with an External ID from one command (data upsert bulk (opens in a new tab), Salesforce CLI Command Reference, checked 2026-10-27). You can even have AI write the small scripts that run each complex step.
Whatever the tool, here’s my strongest preference: I don’t want the production migration to be the first time we perform the migration, and I don’t want each rehearsal to be a handcrafted adventure. If step 17 says “open this CSV, sort by column G, delete the blank rows, copy this formula down, then run Data Loader with these settings,” I’m nervous. Every manual step is a chance for a wrong file, a missed row, a stale version, a bad sort, a forgotten filter, a setting that differs from rehearsal. Some may be unavoidable: document them and test them. But the goal is repeatability, so extract, transform, validate, load, capture results and reconcile should run the same way every time.
If you schedule loads, don’t schedule them more often than they can finish. An hourly job that sometimes takes ninety minutes will start on top of itself; check that the previous run completed before the next one begins.
Keep Every Result, and Bring the Keys Back
Section titled “Keep Every Result, and Bring the Keys Back”For each load, keep the input version, the transformed load file, the job ID, the success and failure results with their errors, timing, record counts and reconciliation outputs. After a big migration, someone will ask “what happened to this record?” and I want evidence, not “I think that was in the third CSV Saturday morning.” Bulk results are only kept for seven days, so download them as you go. Give these artifacts a lifecycle later; don’t throw them away while you still need to prove the move.
Then bring the keys back. The success results carry each record’s new Salesforce ID next to the key you sent. Write them back into the preparation data store, on the row that produced the record: that’s the last frame of module 1’s three sets of keys. On the Zendesk migration I described in module 1, that’s what made everything else possible. With the Salesforce IDs back on every row, I could load in phases (accounts and contacts first, then the cases, then the comments and files that hang off them), and each phase found its parents by the IDs the last one returned. I could do a partial load: just the rows that failed, or just one group. And I could reload: fix a transformation, regenerate the affected rows, and send only those, knowing exactly which Salesforce records they’d update. Without the keys back, every rerun is a guess.
Failure size is a Number of Zeros question too. Twenty failures out of 100 is bad; twenty out of 20 million still needs investigating but is a different signal. Watch rates, not just counts, and classify the failures: validation, missing parent, duplicate key, locking, data type, automation, permissions. Classified, they show you architecture problems instead of a giant error file.
And performance is more than records per second. “We doubled throughput.” What changed? Did locking, failures or retries go up? Did downstream automation fall behind, sharing recalculation back up, another integration get swamped? Did the total cutover actually get shorter? A migration doesn’t run in a vacuum.
Test knowledge. The Bulk API’s success results return each record’s new Salesforce ID with the data you sent, and its failure results return each error; both are kept for seven days. Capture them, write the IDs back to the source or staging data, and you can load in phases, retry only the failures, and reconcile what landed.
Test the Whole Run
Section titled “Test the Whole Run”Loading accounts, then contacts, then orders, each tested separately, isn’t a tested migration. I want a full rehearsal, beginning to end, with the same sequence, transformations, identities, automation strategy and reconciliation, at representative volume. Dependencies appear between steps: a ten-minute delay starts the next load at the wrong time, an unexpected failure rate costs hours of remediation, a sharing recalculation shifts the schedule. The full run tells you whether the migration works, not just whether each command does.
If the rehearsal includes a performance or scale test, put Salesforce’s lead time in the plan. “All tests must be pre-approved. Unapproved testing is subject to throttling or blocking,” and for tests at 120 requests a second or below, the request goes in “at least one week before the testing date” (Salesforce Performance and Scale Test FAQs (opens in a new tab), Salesforce Help, checked 2026-10-27). A rehearsal that gets throttled proves nothing about cutover weekend.
AI Can Write the Script. You Still Own the Run.
Section titled “AI Can Write the Script. You Still Own the Run.”AI is very good at generating transformation scripts, load orchestration, error parsers, reconciliation queries and retry logic. Use it. But generated code can be wrong at enormous speed: a wrong transformation on ten records is ten fixes; on ten million, the Number of Zeros applies to the mistake too. The way I use it is step by step: clean, transform and migrate steps, with every generated command and action tracked. That’s deterministic, auditable automation, not unattended judgment. Test it at realistic scale before you trust it with production data.
Beyond the exam: what AI changes. AI lowers the effort of building migration tooling, and makes it easier to generate and run bulk operations quickly. The larger the operation, the stronger the need for deterministic transformations, tracked steps, rehearsals, controls and reconciliation.
What an Architect Decides Here
Section titled “What an Architect Decides Here”- Which loading mechanism and API version fit the volume and shape of the work, rather than treating a migration like transactional traffic.
- The dependency-driven sequence of objects and relationships, including when records and relationships need separate passes.
- Which operation each set of records gets (insert, update or upsert), based on what the preparation data store knows already exists.
- Where parallel processing is safe, and where concentration, locking or automation justify sorting by parent, a model change, or serial processing.
- Which stable keys, migration identity, record ownership and repeatable tooling make rehearsals and production loads deterministic.
- How results and new IDs come back, so loads can run in phases, retry only failures, and reload safely.
- What evidence, failure classification and full-run rehearsal are required before trusting the process at production scale.
The Loading Dock Still Needs a Plan
Section titled “The Loading Dock Still Needs a Plan”The loading dock moves enormous amounts of data. It doesn’t decide which truck unloads first, where the pallets go, which shipment belongs to which customer, what happens to a damaged pallet, whether two forklifts are using the same aisle, or whether everything that should have arrived did. That’s architecture. Know the Number of Zeros and the shape behind them. Load in dependency order, use stable keys, control concurrency, bring the keys back, make the process repeatable, keep the evidence, and rehearse the whole thing. Then use the loading dock as fast as the architecture safely allows.
Explore
Section titled “Explore”- Salesforce, Bulk API and Bulk API 2.0 Limits and Allocations (opens in a new tab), Developer Limits and Allocations Quick Reference, checked 2026-11-01.
- Salesforce, General Guidelines for Data Loads (opens in a new tab) and Limits (opens in a new tab), Bulk API 2.0 and Bulk API Developer Guide, checked 2026-11-01.
- Salesforce, Best Practices for Deployments with Large Data Volumes, Loading Data from the API (opens in a new tab), Winter ‘27, checked 2026-11-01.
- Salesforce, REST API Developer Guide, Create Records Using sObject Collections (opens in a new tab), checked 2026-11-01.
- Salesforce, SOAP API Developer Guide, create() (opens in a new tab), and Bulk API 2.0, Create a Job (opens in a new tab), checked 2026-11-01.
- Salesforce, Bulk API 2.0 and Bulk API Developer Guide, JobInfo (opens in a new tab) (the Bulk API 1.0 job fields,
concurrencyMode), API version 68.0 (Winter ‘27), checked 2026-11-01. - Salesforce Help, Salesforce Performance and Scale Test FAQs (opens in a new tab), checked 2026-11-01.
- The Integration Architect course: Bulk (coming soon) has the Bulk API in depth.
- In this course: Designing for Scale (hot spots and ownership skew).
- Salesforce Developers, Designing Record Access for Enterprise Scale, Ownership Data Skew (opens in a new tab), checked 2026-11-01.
- Salesforce Developers, Salesforce CLI Command Reference, data upsert bulk (opens in a new tab), checked 2026-11-01.
