You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 18, 2020. It is now read-only.
The DynamoDB Import Export Tool is designed to perform parallel scans on the source table, store scan results in a queue, then consume the queue by writing the items asynchronously to a destination table.
2
+
The DynamoDB Import Export Tool is designed to perform parallel scans on the source table,
3
+
store scan results in a queue, then consume the queue by writing the items asynchronously to a destination table.
3
4
4
5
## Requirements ##
5
6
* Maven
6
7
* JRE 1.7+
7
-
* Pre-existing source and destination DynamoDB tables
8
+
* Pre-existing source DynamoDB tables. The destination table is optional in the CLI; you can choose to create the
9
+
destination table if it does not exist.
8
10
9
11
## Running as an executable
10
-
11
-
1. Build the library:
12
-
13
-
```
14
-
mvn install
12
+
1. Build the library with `mvn install`. This produces the target jar in the target/ directory.
13
+
The CLI's usage follows with required parameters marked by asterisks.
14
+
15
+
```bash
16
+
--consistentScan
17
+
Use this flag to use strongly consistent scan. If the flag is not used
18
+
it will default to eventually consistent scan
19
+
Default: false
20
+
--createDestination
21
+
Create destination table if it does not exist
22
+
Default: false
23
+
--copyStreamSpecificationWhenCreating
24
+
Use the source table stream specification for the destination table
25
+
during its creation.
26
+
Default: false
27
+
--destinationEndpoint
28
+
Endpoint of the destination table
29
+
* --destinationRegion
30
+
Signing region for the destination endpoint
31
+
* --destinationTable
32
+
Name of the destination table
33
+
--help
34
+
Display usage information
35
+
--maxWriteThreads
36
+
Number of max threads to write to destination table
37
+
Default: 1024
38
+
* --readThroughputRatio
39
+
Percentage of total read throughput to scan the source table
40
+
Default: 0.0
41
+
--section
42
+
Section number to scan when running multiple programs concurrently [0,
43
+
1... totalSections-1]
44
+
Default: 0
45
+
--sourceEndpoint
46
+
Endpoint of the source table
47
+
* --sourceRegion
48
+
Signing region for the source endpoint
49
+
* --sourceTable
50
+
Name of the source table
51
+
--totalSections
52
+
Total number of sections to divide the scan into
53
+
Default: 1
54
+
* --writeThroughputRatio
55
+
Percentage of total write throughput to write the destination table
56
+
Default: 0.0
15
57
```
16
58
17
-
2. This produces the target jar in the target/ directory, to start the replication process:
18
-
19
-
java -jar dynamodb-import-export-tool.jar
20
-
21
-
--destinationEndpoint <destination_endpoint> // the DynamoDB endpoint where the destination table is located.
22
-
23
-
--destinationTable <destination_table> // the destination table to write to.
24
-
25
-
--sourceEndpoint <source_endpoint> // the endpoint where the source table is located.
26
-
27
-
--sourceTable <source_table>// the source table to read from.
28
-
29
-
--readThroughputRatio <ratio_in_decimal> // the ratio of read throughput to consume from the source table.
30
-
31
-
--writeThroughputRatio <ratio_in_decimal> // the ratio of write throughput to consume from the destination table.
32
-
33
-
--maxWriteThreads <numWriteThreads> // (Optional, default=128 * Available_Processors) Maximum number of write threads to create.
34
-
35
-
--totalSections <numSections> // (Optional, default=1) Total number of sections to split the bootstrap into. Each application will only scan and write one section.
36
-
37
-
--section <sectionSequence> // (Optional, default=0) section to read and write. Only will scan this one section of all sections, [0...totalSections-1].
38
-
39
-
--consistentScan <boolean> // (Optional, default=false) indicates whether consistent scan should be used when reading from the source table.
59
+
2. An example command you can use on one EC2 host to copy from one table `foo`in`us-east-1` to a new table
> **NOTE**: To split the replication process across multiple machines, simply use the totalSections & section command line arguments, where each machine will run one section out of [0 ... totalSections-1].
72
+
>**NOTE**: To split the replication process across multiple machines, simply use the totalSections & section
73
+
command line arguments, where each machine will run one section out of [0 ... totalSections-1].
42
74
43
75
## Using the API
76
+
Find some examples of how to use the Import-Export tool's API below.
77
+
The first demonstrates how to use the API to copy data from one DynamoDB table to another.
78
+
The second demonstrates how to enqueue the data in a DynamoDB table in a
79
+
`BlockingQueueConsumer` in memory.
44
80
45
81
### 1. Transfer Data from One DynamoDB Table to Another DynamoDB Table
46
82
47
-
The below example will read from "mySourceTable" at 100 reads per second, using 4 threads. And it will write to "myDestinationTable" at 50 writes per second, using 8 threads.
48
-
Both tables are located at "dynamodb.us-west-1.amazonaws.com". (to transfer to a different region, create 2 AmazonDynamoDBClients
83
+
The below example will read from "mySourceTable" at 100 reads per second, using four threads.
84
+
And it will write to "myDestinationTable" at 50 writes per second, using eight threads.
85
+
Both tables are located at "dynamodb.us-west-1.amazonaws.com".
86
+
To transfer to a different region, create two AmazonDynamoDBClients
49
87
with different endpoints to pass into the DynamoDBBootstrapWorker and the DynamoDBConsumer.
0 commit comments