- Newest
- Most votes
- Most comments
If you merely want to copy the full database to a new host, and then change some of the data values and such, you may be best served by using mysqldump
and dumping the source database, then importing it to the new host, where you run a query to make the transformations and update the values you want. this task?
A new host will not be established; instead, we will utilize an existing host. The existing database will serve as the foundation for creating a new database after the necessary transformations, and both databases will coexist on the same host.
From a cost and performance perspective, I would suggest you follow an approach where "everything" happens within the host. Serverless models like AWS Glue have a pay-per-use billing model where you pay for each byte of data that is processed. Moving data between RDS, EC2 and S3 would also involve data transfer cost.
If I were you, I would:
- Create a Stored Procedure in db1 that does the data transformation and load the data in db2.
- If the data load needs to happen instantly when data changes in db1, then write triggers in source tables to invoke the stored procedure.
- If the data needs to be updated periodically, then find a way to invoke the stored procedure at fixed intervals. For example: a) using an ETL package running on an EC2 instance or b) a Lambda function (triggered by an EventBridge Schedueler) that executes the stored procedure.
Relevant content
- asked 9 months ago
- Accepted Answerasked 4 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 7 months ago
Is this a one-time ETL job, or an ongoing one?
The task will be performed occasionally to transfer data from one database to another on the same host after transformation.