thumbtack / dynamodb-rename

Rename a DynamoDB table by copying the content (in real time)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dynamodb-rename

It's not actually possible to rename a DynamoDB table.

A common workaround is to create a new table and copy the data (it is also possible to use AWS Data Pipeline to export/import data via S3).

dynamodb-rename simplifies the task of copying data to a new table by:

  • taking a consistent snapshot of the source table using the Scan API;
  • writing the scanned data to the destination table with the BatchWriteItem API;
  • leveraging DynamoDB Streams to replay all data inserted/modified/deleted on the source table during the copy operation and continuously propagating changes in near real time.

It can also optionally create the destination table and/or enable a stream on the source table.

A client-side rate limiter is used to control (independently) read and write workloads.

Example

Copy all items in original-table to new-table, both in us-west-2.

Limit reads to 750 queries per second and writes to 1000 queries per second, with 10 workers processing writes in parallel.

dynamodb-rename --src original-table --src-region us-west-2 --dst new-table --dst-region us-west-2 --write-qps 200 
--read-qps 750 --write-workers 5 --create-dst --enable-stream

About

Rename a DynamoDB table by copying the content (in real time)

License:Apache License 2.0


Languages

Language:Go 99.3%Language:Makefile 0.7%