Batch-loading data into DynamoDB

We will first discuss how to batch-load data into DynamoDB from a comma-separated values (CSV) file called sample_data/dynamodb-sample-data.txt. Rather than insert an individual statement for each item, this is a much more efficient process, as the data file is decoupled from the Python code:


Add another method, called update_dynamo_event_counter(), that updates DynamoDB records using the DynamoRepository class.

Here are the contents of the serverless-microservice-data-api/aws_dynamo/ Python script:

from boto3 import resource ...

Get Building Serverless Microservices in Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.