Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export from Amazon Redshift into an RDS MySQL database

I am aware that there are many ways to export data from RDS into Redshift, but I was wondering if there is any way to export data directly from Redshift directly into an RDS MySQL table (using preferably SQL or Python)?

Example use case: an intensive Redshift query which creates a daily report that needs to be read from a web-app

Or is my only option:

Redshift ==> Export ==> S3 ==> Import ==> RDS 
like image 425
p_mcp Avatar asked Apr 08 '16 14:04

p_mcp


2 Answers

You have couple of simple solutions for that.

The first one is to use a scheduled AWS Lambda function that will trigger an UNLOAD command with your aggregation. This UNLOAD can use the single file flag or use the option of multiple files. These files will be written to S3, from where you can trigger another Lambda function that will load the data into MySQL. The option of a single file or multiple files depends on your MySQL version and the loading tools that you have there.

The second option is to use RDS with PostgreSQL and not with MySQL. PostgreSQL has the option of opening dblink into Redshift and through this dblink you can query the data into the RDS.

like image 159
Guy Avatar answered Oct 10 '22 17:10

Guy


No, there is no command to directly export data from Redshift to a database.

The only options would be to UNLOAD to Amazon S3 or to perform SELECT queries and move the resulting data yourself. Some 3rd-party software would likely be able to do this.

like image 22
John Rotenstein Avatar answered Oct 10 '22 15:10

John Rotenstein