如何将数据从 Amazon DynamoDB 导出到 MySQL 服务器

2022-01-15 00:00:00 nosql amazon-dynamodb mysql

我没有处理 Amazon AWS DynamoDB 等 nosql 数据库的经验.

I have no experience dealing with nosql databases such as Amazon AWS DynamoDB.

我有一些数据存储在 Amazon AWS DynamoDB 中.

I have some data stored in Amazon AWS DynamoDB.

是否可以将数据从 DynamoDB 导出到 MySQL 服务器?如果是这样,如何去实现呢?

Is it possible to export data from DynamoDB to MySQL Server ? If so, how to go about accomplishing that ?

谢谢,

推荐答案

我会提取 CSV 格式的数据.这个 "DynamoDBtoCSV" 工具看起来很有前途.然后您可以使用 将此 CSV 文件导入您的 MySQL 数据库加载数据文件.

I would extract the data in CSV format. This "DynamoDBtoCSV" tool seems promising. Then you can import this CSV file into your MySQL database with LOAD DATA INFILE.

缺点是您 1. 需要先创建接收结构,然后 2. 对每个表重复该过程.但应该不会太复杂 1. 从 DynamoDBtoCSV 输出的第一行生成相应的 CREATE TABLE 语句,2. 从批处理循环运行操作.

The drawback is that you 1. need to create the receiving structure first and 2. repeat the process for each table. But it shouldn't be too complicated to 1. generate a corresponding CREATE TABLE statement from the first line output by DynamoDBtoCSV, and 2. run the operation in a loop from a batch.

现在我问自己,MySQL 是否是您作为目标数据库的最佳选择.MySQL 是关系数据库,而 DynamoDB 是 NoSQL(具有可变长度聚合、非标量字段值等).将此结构扁平化为关系模式可能不是一个好主意.

Now I am asking myself if MySQL is your best call as a target database. MySQL is a relational database, while DynamoDB is NoSQL (with variable length aggregates, non-scalar field values, and so on). Flatenning this structure into a relational schema may not be such a good idea.

相关文章