AWS Builder Center
Load S3 data into DynamoDB without touching live traffic

Load S3 data into DynamoDB without touching live traffic

DynamoDB bulk put items loads S3 files into live tables off dedicated capacity, with per-record condition expressions, two speed tiers, and S3 reports.

DevOps, Architecture, Security
There's a genre of incident report whose root cause is a background job borrowing the table's write capacity. Loading machine learning insights, catalog updates, or backfills into a live DynamoDB table always meant a custom pipeline or Glue/EMR orchestration, plus capacity math so bulk writes don't starve the application.  The AWS Database Blog announced bulk put items today : a managed S3 import on dedicated capacity, separate from everything the table is serving.

What AWS shipped

Bulk put items is an asynchronous job. Point it at an S3 location of line-delimited DynamoDB JSON or Ion records, optional gzip/zstd, and the service reads, validates, and writes each item. Anything that doesn't land goes in a report to an S3 bucket you choose, and files and table can live in separate accounts.
The writes run on dedicated capacity and don't count toward read/write CloudWatch metrics, so alarms and auto scaling stay untouched, and AWS claims no throttling risk. I'll believe it after the first production run.
Conflict handling travels in the data: each record optionally carries a condition expression, same grammar as PutItem. The example input file from the announcement:
{"Item": {"Artist": {"S": "No One You Know"}, "SongTitle": {"S": "Call Me Today"}}}
{"Item": {"Artist": {"S": "Acme Band"}, "SongTitle": {"S": "Happy Day"}, "Origin": {"S": "import"}}, "ConditionExpression": "attribute_not_exists(Artist)"}
{"Item": {"Artist": {"S": "The Ternaries"}, "SongTitle": {"S": "Blue"}, "Version": {"N": "12"}}, "ConditionExpression": "#v < :v", "ExpressionAttributeNames": {"#v": "Version"}, "ExpressionAttributeValues": {":v": {"N": "12"}}}
Record 1 is a plain write. Record 2 is insert-only: attribute_not_exists on the partition key protects items the application updated after the export was taken. Record 3 lands only when its incoming copy is newer than what's in the table. A file can mix all three styles. The footgun AWS states plainly: a condition meant for every item must ride on every record.
A condition-skipped record isn't a failure: it counts as processed and is noted in the report. Operations end in COMPLETED, COMPLETED_WITH_ERRORS, FAILED, or CANCELLED; list-bulk-operations keeps 90 days of history; cancel-bulk-operation stops a run without rolling back what already landed.
Imported items are ordinary writes downstream: secondary indexes update automatically on isolated replication capacity, and they appear in DynamoDB Streams and Kinesis Data Streams as application writes, so zero-ETL consumers need no new plumbing. The import adds write throughput on top of the normal rate, which stream consumers pay for.

Setup, in one command

aws dynamodb start-bulk-put-items \
--table-name arn:aws:dynamodb:us-east-1:123456789012:table/MusicCollection \
--input-s3-configuration '{"S3Bucket":"my-import-bucket","S3KeyPrefix":"daily/","InputFormat":"DYNAMODB_JSON"}' \
--output-s3-configuration '{"S3Bucket":"my-report-bucket","S3KeyPrefix":"reports/","OutputType":["ERROR","CONDITION_CHECK_FAILURE"]}' \
--performance-tier ACCELERATED
OutputType picks the report's contents: ERROR, CONDITION_CHECK_FAILURE, or both. The operation runs with the caller's permissions: account-scoped dynamodb:StartBulkOperation, table-scoped dynamodb:BulkPutItems, input-bucket read, report-bucket write, and access to the KMS keys involved.
It returns a bulk operation ARN; a client token on every request means a retried start won't duplicate the import. describe-bulk-operation shows zero items processed for the first few minutes: provisioning is a fixed startup cost.
Each report record names the source object and position, the error, and for condition checks the attempted and current item. Treat COMPLETED_WITH_ERRORS as normal operation: fix the records and re-import only those.

Standard or Accelerated

Standard is the cost-effective tier for flexible-timing work: enrichment, background population, backfills. Accelerated buys higher throughput for deadline work: migrations, recovery with a recovery time objective, recurring loads in a fixed window.
AWS's Accelerated estimates, caveats attached (well-scaled table, high-cardinality keys, no GSI replication, split input, results vary):
1 KB items written
Estimated completion time
10 million
Under 10 minutes
100 million
Under 1 hour
1 billion
2 to 4 hours
The sizing advice: Standard without a deadline, Accelerated with one; trust recurring-job completion times only after a few same-shaped runs.

Tips worth more than the setup guide

Make every import re-runnable. The client token only deduplicates a retried start call; a deliberate re-run is a new operation, and conditions are what stop it from overwriting items the application wrote since the export. Recovery from a canceled run or corrected error file then means rerunning the same file.
Shape the input for parallelism. The service parallelizes across input objects, so split large datasets into similarly sized S3 objects with high-cardinality, evenly spread keys; a skewed file funnels the import through a few partitions and is slower at either tier.
Watch the operation, not the table. Bulk writes never appear in consumed-capacity metrics, so table alarms can't catch an import gone sideways. Wire the scheduler to tell COMPLETED from COMPLETED_WITH_ERRORS, and feed the report into the retry path. MaxWriteRequestUnits caps the write rate for lagging stream consumers, though a too-low ceiling can push the operation past its time limit and fail it.

Costs

Billing is byte-based, per GB at the tier's rate with a 1 KB minimum, counted separately for the table and each index the write reaches. US East (N. Virginia): $0.10 per GB on Standard, $0.20 on Accelerated. A 1.1 KB item bills as 1.1 KB, where the write request unit model would round it up to 2 KB; 100 million 1 KB items is 100 GB, or $10.00 on Standard and $20.00 on Accelerated. Report objects bill at standard S3 rates.
Validation rejections are free; condition-check failures are billed, since the service reads and evaluates the existing item, at the 1 KB minimum even when it doesn't exist. Other Regions and the Standard-Infrequent Access table class rate separately on the pricing page.

The security-review agenda

The report is the item. A condition-failure record carries newImage and oldImage, the attempted write and the current one, side by side. If the table holds anything sensitive, the report bucket becomes a second copy of disputed records: own KMS key, restricted access, lifecycle policy, set before the first import.
Scope the new actions narrowly: attach dynamodb:BulkPutItems to specific table ARNs, and keep dynamodb:StartBulkOperation out of accounts with no imports to start; CloudTrail answers the who-and-when question. Standard runs in all commercial Regions plus AWS GovCloud (US), while Accelerated has a shorter published list.
If you maintain a rate-limited custom writer, one API call now handles the reading, writing, conflict resolution, and reporting. Keep PutItem and BatchWriteItem for seconds-scale jobs and let a background job outside your metrics take the bulk work. The pipeline you no longer maintain was always the most expensive part of the load.

More information:
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article