What is the best way to import data to an existing DynamoDB table?

2

Let's say I have an existing DynamoDB table and the data is deleted for some reason. I have a backup of the table in AWS Backups as well as an export of the table data in S3 in DynamoDB JSON or Amazon ION format. How can I import this data to the existing DynamoDB table? And what is the easiest and cheapest solution to this? Thanks!

PD: I am new to AWS and I have looked at bulk upload data options provided by the knowledge center and an AWS blog for importing data via Lambda. They both require to load a json or csv to s3, but what if I want to use the existing AWS Backup or the DynamoDB JSON to re-populate this existing table? Thanks! Maybe I am complicating myself a bit

jesusER
asked 2 years ago13354 views
3 Answers
1

Based on your situation you have 2 options to import the data without having to write any code:

  • DynamoDB Import From S3 (Newly Released)

    • Using this approach you can import your data stored on S3 in DDB JSON, ION or even CSV
    • The cost of running an import is based on the uncompressed size of the source data in S3, multiplied by a per-GB cost, which is $0.15 per GB in the US East (Northern Virginia) Region. Tables with one or more global secondary indexes (GSIs) defined incur no additional cost, but the size of any failed records adds to the total cost.
    • More reading here: blog
  • Use AWS Backup restore option

    • Using this approach you can easily restore your backed up data from AWS Backup Service
    • The cost for restoring from a warm back up is $0.15 per GB n the US East (Northern Virginia) Region
profile pictureAWS
EXPERT
answered 2 years ago
  • Thank you for the information, this creates a new table in DynamoDB right? I am new to AWS and I am currently building a web app in Amplify, do you know how to edit the AppSync schema or CloudFormation template to point to this new restored table?

    I've tried deleting a table after backing it up and then restore it with the same name but amplify push will not work and return errors like 'Resource is not in the state stackUpdateComplete'

  • DynamoDB Import From S3 does not let you import data to existing DynamoDB table. You have to create new table. It would be great if they let you import to existing table too.

0
Accepted Answer

I forgot to update this post with the approach I took. I created a Lambda function that** lists the data from a source table**, transforms it into 'PutRequest' batches of 25, and uses to batchWriteItem method of DynamoDB to upload the data into a destination table

jesusER
answered a year ago
profile picture
EXPERT
reviewed 3 days ago
  • Can we do this for replicating data to new empty dynamodb that's been created on another account? (IAC)

-1
profile pictureAWS
EXPERT
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions