{"id":59219,"date":"2023-11-11T13:40:47","date_gmt":"2023-11-11T08:10:47","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=59219"},"modified":"2023-11-24T13:55:12","modified_gmt":"2023-11-24T08:25:12","slug":"snapshot-migration-to-s3-and-extract-data-from-snapshot-using-athena","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/snapshot-migration-to-s3-and-extract-data-from-snapshot-using-athena\/","title":{"rendered":"Snapshot Migration to S3 and Extract Data from Snapshot using Athena"},"content":{"rendered":"<h3><b>Introduction<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Sometimes We have to keep our database backup for longer retention for Security and DR Compliances in RDS. But as we know, if we have a longer backup period in RDS, it will also create more burden on the pocket, as RDS charges for storage in Normal S3 bucket format. So we can export our backup snapshots from RDS to an S3 bucket with Apache Parquet Format, which can save some charges, and we can use those snapshot data for future reports or compliance checks as well using Athena and Glue.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We can export all types of backup from RDS to S3<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Steps to export to s3:<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Create an S3 bucket with Proper IAM Permission<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Create a KMS key for server-side encryption (SSE)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We can use CLI or GUI to perform this action<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">No Impact on Performance as export runs in the background<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u00a0Data will be exported into S3 in Apache Parquet format. It is 2x faster and stores 1\/6 of the storage compared to the normal test format<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We can use that exported data to create reports using Athena and EMR<\/span><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2><b>Architecture of Migration Process<\/b><\/h2>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59150 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Architecture-1024x684.png\" alt=\"\" width=\"625\" height=\"417\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Architecture-1024x684.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Architecture-300x200.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Architecture-768x513.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Architecture-1536x1025.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Architecture-624x417.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Architecture.png 1769w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<h3><b>Used Tools and AWS Components &#8211;<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">AWS RDS<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">AWS S3<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">AWS KMS<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">AWS IAM<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">AWS Glue<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">AWS Crawler<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">AWS Athena<\/span><\/li>\n<\/ul>\n<h3><b>Steps Performed for this Activity<\/b><\/h3>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Create an S3 bucket in AWS\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Create a KMS Key or use the Existing Key for Encryption<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Take RDS Database Snapshot<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Export Snapshot to S3 Bucket with Parquet Format<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Validate the Snapshot Migration (Check Size and Cost)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Create a Glue Crawler and Run it to fetch data<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Use Athena to Execute Query and generate Report\u00a0 &#8211; Data Will be stored in CSV format in the S3 bucket location<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">You can also use those output files to import data into another database.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<h3><b>Execution Steps &#8211;\u00a0<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">This process has been performed on the Beta Database of PostgreSQL Snapshot.<\/span><\/li>\n<\/ul>\n<h3><b>Step 1: Export of RDS DB Snapshot to S3 Bucket<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Take a Snapshot of the Beta Database from RDS<\/span><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59202 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/RDS_Snapshot_Migration.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/RDS_Snapshot_Migration.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/RDS_Snapshot_Migration-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/RDS_Snapshot_Migration-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/RDS_Snapshot_Migration-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/li>\n<li><span style=\"font-weight: 400;\">Export Database Snapshot to S3 bucket from Snapshot Menu<\/span><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59201 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/S3_Bucket_export.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/S3_Bucket_export.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/S3_Bucket_export-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/S3_Bucket_export-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/S3_Bucket_export-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59203 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Snapshot_exported_history.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Snapshot_exported_history.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Snapshot_exported_history-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Snapshot_exported_history-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Snapshot_exported_history-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Created KMS key as \u201cglue-kms\u201d in Key Management Service with default settings and copied the arn of the key created to export db snapshot configuration, and Crawler will use same to extract data by AWS Glue.<\/span><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59204 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/KMS_KEY.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/KMS_KEY.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/KMS_KEY-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/KMS_KEY-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/KMS_KEY-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select S3 Bucket to upload and provide a proper IAM Role with a Newly created KMS Key to encrypt the database snapshot.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Snapshot has been exported in the S3 bucket and checked directly from the S3 Console.<\/span><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59206 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Bucket_data.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Bucket_data.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Bucket_data-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Bucket_data-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Bucket_data-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">After completion of the export task to the S3 bucket, I am able to see the databases and tables in the bucket named test-beta.<\/span><\/li>\n<\/ul>\n<h3><b>Step 2: Create and Run Crawler in AWS Glue to export S3 data in Glue Data Catalog<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">In AWS Glue Console, Go to the crawler option and click on the add crawler button. Then, give the crawler name as beta-demo and click next<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Click on Next and select a data source\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select the S3 folder and provide the path that you want to extract and get data from a particular table or full database.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Here, we have selected a specific table customer_master to check.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select the IAM role which AWS Glue and Crawler will use to access Snapshot from S3 Bucket<\/span><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59205 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/IAM_for_crawler.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/IAM_for_crawler.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/IAM_for_crawler-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/IAM_for_crawler-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/IAM_for_crawler-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/li>\n<\/ul>\n<h2><strong>Create Database<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">1. Review the Created Crawler<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59207 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>2. Select Data Source for Crawler<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59209 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler__data_source.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler__data_source.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler__data_source-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler__data_source-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler__data_source-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>3. Create a schedule for Crawler<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59208 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Crawler_schedule.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Crawler_schedule.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Crawler_schedule-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Crawler_schedule-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Crawler_schedule-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">4. Run The Crawler and see the process<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59209 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler__data_source.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler__data_source.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler__data_source-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler__data_source-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Create_crawler__data_source-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">5. Check the Database in AWS Glue, and you will find the table that the crawler extracted from the S3 Bucket<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59214 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Crawler_database.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Crawler_database.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Crawler_database-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Crawler_database-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Crawler_database-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3><b>Step 3: In Athena, run of queries and store of queries output in S3 bucket<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">1. Check Query Editor<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59215 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_dashboard.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_dashboard.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_dashboard-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_dashboard-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_dashboard-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">2. In Query Editor, You will find the Data Source as AWS Data Catalog, and demodb will be there as a database because it is the only database available right now.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59216 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_query_run.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_query_run.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_query_run-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_query_run-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_query_run-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">3. Go to Settings and specify the location to store output, which you will get after the execution of queries in Athena , we have provided the Same S3 bucket with a New Folder in it.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59217 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_query_output_dest.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_query_output_dest.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_query_output_dest-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_query_output_dest-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Athena_query_output_dest-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">4. Execute the query and see the result.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">5. Check the Output in the Query editor and the S3 bucket, where it will be saved in CSV format.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-59218 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/athena_output_store.jpg\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/athena_output_store.jpg 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/athena_output_store-300x127.jpg 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/athena_output_store-768x325.jpg 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/athena_output_store-624x264.jpg 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">You can now download the CSV file open it, and check the result to verify.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Notes:-\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">A crawler will be used if the requirement comes to get a report or data from any historical snapshot<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Costing of the crawler will be based on the minutes of usage<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Costing of Athena will be based on the data explored from snapshot<\/span><\/li>\n<\/ul>\n<h2><b>Costing Summary<\/b><\/h2>\n<table>\n<tbody>\n<tr>\n<td><a href=\"https:\/\/aws.amazon.com\/s3\/pricing\/#:~:text=50%20TB%20\/%20Month-,%240.025%20per%20GB,-Next%20450%20TB\"><span style=\"font-weight: 400;\">S3 Storage &#8211; $0.025 per GB per month<\/span><\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/aws.amazon.com\/kms\/pricing\/#:~:text=Each%20AWS%20KMS%20key%20that%20you%20create%20in%20KMS%20costs%20%241\/month%C2%A0(prorated%20hourly)\"><span style=\"font-weight: 400;\">KMS Key &#8211; $1 per key per month<\/span><\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/aws.amazon.com\/kms\/pricing\/#:~:text=Asia%20Pacific%20(Mumbai)-,%240.03%20per%2010%2C000%20requests,-%240.03%20per%2010%2C000\"><span style=\"font-weight: 400;\">KMS encrypt pricing &#8211; $0.03 for encrypting 10,000 objects<\/span><\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/aws.amazon.com\/rds\/aurora\/pricing\/#:~:text=For%20example%2C%20suppose%20you%20have%20a%20100%20GB%20snapshot%20and%20you%20use%20filtering%20to%20select%20a%2010%20GB%20table%20from%20this%20snapshot%20to%20export%20to%20Amazon%20S3.%20To%20export%20this%20data%2C%20you%20would%20pay%20100%20GB%20*%20%240.010%20per%20GB%20of%20snapshot%20size.%20Subsequent%20exports%20of%20data%20from%20the%20same%20snapshot%20are%20not%20incremental\"><span style=\"font-weight: 400;\">RDS Export to S3 Cost &#8211; $0.010 per GB of snapshot size<\/span><\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/aws.amazon.com\/glue\/pricing\/#:~:text=%240.44%20per%20DPU%2DHour%2C%20billed%20per%20second%2C%20with%20a%2010%2Dminute%20minimum%20per%20crawler%20run\"><span style=\"font-weight: 400;\">Glue Crawler Pricing &#8211; $0.44 per DPU-Hour, billed per second, with a 10-minute minimum per crawler run<\/span><\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/aws.amazon.com\/athena\/pricing\/#:~:text=%245.00%20per%20TB%20of%20data%20scanned\"><span style=\"font-weight: 400;\">Athena Pricing &#8211; $5 per TB of data scanned<\/span><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<h2><b>Cost Estimation for the Complete Operation<\/b><\/h2>\n<table>\n<tbody>\n<tr>\n<td><b>Total Size of Snapshots (TB)<\/b><\/td>\n<td><b>65<\/b><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><b>Activity<\/b><\/td>\n<td><b>Quantity<\/b><\/td>\n<td><b>Rate (per quantity&#8217;s dimension)<\/b><\/td>\n<td><b>Cost<\/b><\/td>\n<td><b>Frequency<\/b><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td colspan=\"2\"><b>Trial Performed on a snapshot<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">KMS Key<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$1.00<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$1.00<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Monthly<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Size of Snapshot (TB)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">2.5<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">S3 Storage (GB)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">6,500<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$0.025<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$162.50<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Monthly<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Size after Compression (TB)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">0.239<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">S3 API (number of PUT objects)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">3209205<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$0.0000153<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$48.95<\/span><\/td>\n<td><b>One-time<\/b><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Objects created from snapshot migration<\/span><\/td>\n<td><span style=\"font-weight: 400;\">118000<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">KMS Encrypt<\/span><\/td>\n<td><span style=\"font-weight: 400;\">3209205<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$0.000003<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$9.63<\/span><\/td>\n<td><b>One-time<\/b><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">S3 API Cost<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1.8<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">RDS Export (per GB)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">65000<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$0.01<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$650.00<\/span><\/td>\n<td><b>One-time<\/b><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Crawler Running Minutes<\/span><\/td>\n<td><span style=\"font-weight: 400;\">240<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$0.0073<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$1.76<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Monthly<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td colspan=\"2\"><b>Assumptions Derived<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Athena Data Scanned (TB)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">3<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$5.00<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$15.00<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Monthly<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Compression Ratio<\/span><\/td>\n<td><span style=\"font-weight: 400;\">10:1<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><b>Total<\/b><\/td>\n<td><b>$888.84<\/b><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Number of Objects per GB after Compression<\/span><\/td>\n<td><span style=\"font-weight: 400;\">494<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">API Cost per GB after compression<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$0.0075<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">API Cost per object<\/span><\/td>\n<td><span style=\"font-weight: 400;\">$0.000015<\/span><\/td>\n<\/tr>\n<tr>\n<td colspan=\"5\"><b>NOTE<\/b><span style=\"font-weight: 400;\">: Additional KMS API charges will be applicable when Crawler and Athena will decrypt the objects<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td colspan=\"2\"><b>Additional Assumptions<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Crawler running hours per month<\/span><\/td>\n<td><span style=\"font-weight: 400;\">4<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Data Scanned by Athena per month (TB)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">3<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Number of KMS Keys<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<h3><b>Comparison Of Costing<\/b><\/h3>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">Operation<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Old Costing<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Changes<\/span><\/td>\n<td><span style=\"font-weight: 400;\">New Estimated Cost<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Storage<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1500 USD per Month<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Snapshot migrated to S3 and size will be reduced up to 8 times<\/span><\/td>\n<td><span style=\"font-weight: 400;\">190 USD per Month<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>Introduction Sometimes We have to keep our database backup for longer retention for Security and DR Compliances in RDS. But as we know, if we have a longer backup period in RDS, it will also create more burden on the pocket, as RDS charges for storage in Normal S3 bucket format. So we can export [&hellip;]<\/p>\n","protected":false},"author":1671,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":199},"categories":[1174,4308,4831],"tags":[4739],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/59219"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1671"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=59219"}],"version-history":[{"count":2,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/59219\/revisions"}],"predecessor-version":[{"id":59426,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/59219\/revisions\/59426"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=59219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=59219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=59219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}