I have been creating a new RDS table every day that sometimes reaches about 10 GB in that day. My goal is to dump this table to S3 more efficiently.
My current method of doing this is:
SELECT * FROM table;
Dump those rows to a CSV
Upload that CSV to S3
Delete the CSV file
Is there a way that I am able to dump the RDS table to S3 directly instead of generating that CSV locally and then dumping that to S3?
Check out the Database Migration Service of Amazon.
https://aws.amazon.com/dms/
I found creating a task for dumping RDS to S3 to be fairly straight forward in the console and this guide should applicable to you even those it discusses Aurora: https://aws.amazon.com/blogs/database/replicate-data-from-amazon-aurora-to-amazon-s3-with-aws-database-migration-service/
I have a lambda that is scheduled to run on a periodic basis that kicks off a DMS task to dump a few tables of a database.
The code for the lambda (or just a manual job) is really simple (Python 3.6):