{"id":13818,"date":"2020-03-27T10:05:39","date_gmt":"2020-03-27T09:05:39","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/"},"modified":"2020-03-27T10:05:39","modified_gmt":"2020-03-27T09:05:39","slug":"using-aws-storage-gateway-as-a-backup-target-for-postgresql","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/","title":{"rendered":"Using AWS Storage Gateway as a backup target for PostgreSQL"},"content":{"rendered":"<p>In the <a href=\"https:\/\/www.dbi-services.com\/blog\/sending-postgresql-data-to-aws-s3-by-using-aws-kinesis-data-streams\/\" target=\"_blank\" rel=\"noopener noreferrer\">last post<\/a> we had a quick look at <a href=\"https:\/\/aws.amazon.com\/kinesis\/\" target=\"_blank\" rel=\"noopener noreferrer\">AWS Kinesis<\/a> data streams and how you can push data to <a href=\"https:\/\/aws.amazon.com\/s3\/\" target=\"_blank\" rel=\"noopener noreferrer\">AWS S3<\/a> using <a href=\"https:\/\/aws.amazon.com\/kinesis\/data-firehose\/\" target=\"_blank\" rel=\"noopener noreferrer\">AWS Firehose<\/a>. Another great AWS service is <a href=\"https:\/\/aws.amazon.com\/storagegateway\/\" target=\"_blank\" rel=\"noopener noreferrer\">AWS Storage Gateway<\/a> and in this post we&#8217;ll use that to push our PostgreSQL backups to AWS. The primary usage of AWS Storage Gateway is to extend you local storage to AWS so that you do not have to extend your local storage on one side and on the other side safely can store data offsite for backup purposes. We are already using that at some of our customers and experiences with that are quite well. One important point to keep in mind when you are using AWS Storage Gateway is: In case you need to restore the data to your on-prem location you will be charged for the outgoing traffic, so it might be a good idea to <a href=\"https:\/\/calculator.s3.amazonaws.com\/index.html\" target=\"_blank\" rel=\"noopener noreferrer\">calculate the costs<\/a> before you start using it. <\/p>\n<p>The initial deployment of an AWS Storage Gateway, as usual, is quite simple. Using the AWS console this is matter of a few clicks:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_1.jpg\" alt=\"\" width=\"1000\" height=\"390\" class=\"aligncenter size-full wp-image-38558\" \/><\/a><\/p>\n<p>AWS Storage gateway comes with three types you can chose from:<\/p>\n<ul>\n<li>File gateway: This is what we&#8217;ll be using and it provides a file interface to AWS S3 using standard file protocols like NFS and SMB<\/li>\n<li>Volume gateway: This provides AWS backed cloud volumes that can by mounted over iSCSI, data goes to AWS S3<\/li>\n<li>Tage gateway: This provides virtual tape storage you can use with your on-prem backup solutions and data goes to <a target=\"_blank\" rel=\"noopener noreferrer\">AWS Glacier<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_2.jpg\" alt=\"\" width=\"1000\" height=\"345\" class=\"aligncenter size-full wp-image-38559\" \/><\/a><\/p>\n<p>The AWS Storage Gateway comes as an appliance and depending on what you have available on-prem you import that either into your VMware ESXi, Microsoft Hyper-V 2012R2\/2016 or KVM based virtual infrastructure. You can also use an <a href=\"https:\/\/aws.amazon.com\/ec2\/\" target=\"_blank\" rel=\"noopener noreferrer\">EC2 instance<\/a> and this is what we&#8217;ll be using here because it is the easiest way to deploy that for testing:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_3.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_3.jpg\" alt=\"\" width=\"1000\" height=\"441\" class=\"aligncenter size-full wp-image-38561\" \/><\/a><\/p>\n<p>I am not going to provide all the screenshots for setting up the EC2 instance as that is straight forward, just the most important ones. For production usage <a href=\"https:\/\/docs.aws.amazon.com\/storagegateway\/latest\/userguide\/Requirements.html#requirements-hardware-ec2\" target=\"_blank\" rel=\"noopener noreferrer\">AWS recommends several instance types<\/a>. We&#8217;ll be using a small one here as it is only a test:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_4.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_4.jpg\" alt=\"\" width=\"1000\" height=\"245\" class=\"aligncenter size-full wp-image-38569\" \/><\/a><\/p>\n<p>As we&#8217;ll be accessing the Storage Gateway from a location outside AWS we need a pubic IP address for the EC2 instance:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_5.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_5.jpg\" alt=\"\" width=\"1000\" height=\"295\" class=\"aligncenter size-full wp-image-38572\" \/><\/a><\/p>\n<p>For the File Gateway we need one additional disk with a minimum recommended size of 150GB:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_6.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_6.jpg\" alt=\"\" width=\"1000\" height=\"212\" class=\"aligncenter size-full wp-image-38575\" \/><\/a><\/p>\n<p>You need to make sure that the attached security group allows access from your local machines, at least for HTTP, HTTPS, NFS and SMB. An overview of the port requirements is <a href=\"https:\/\/docs.aws.amazon.com\/storagegateway\/latest\/userguide\/Resource_Ports.html\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_7.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_7.jpg\" alt=\"\" width=\"1000\" height=\"422\" class=\"aligncenter size-full wp-image-38577\" \/><\/a><\/p>\n<p>For the remaining EC2 settings this is standard stuff so no screenshots for that. Wait until the EC2 instance is running and make a note of the public IP address (you will need it in the next step of the Storage Gateway configuration):<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_8.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_8.jpg\" alt=\"\" width=\"1000\" height=\"237\" class=\"aligncenter size-full wp-image-38579\" \/><\/a><\/p>\n<p>Once the EC2 instance is ready we can go back to the Storage Gateway configuration and provide the public IP address of the EC2 instance we just created:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_9.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_9.jpg\" alt=\"\" width=\"1000\" height=\"390\" class=\"aligncenter size-full wp-image-38580\" \/><\/a><br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_10.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_10.jpg\" alt=\"\" width=\"1000\" height=\"302\" class=\"aligncenter size-full wp-image-38581\" \/><\/a><\/p>\n<p>If the connection fails in the next step go back to your security group configuration because then required ports are probably missing. If all is fine the Storage Gateway can be activated in the next screen:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_11.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_11.jpg\" alt=\"\" width=\"1000\" height=\"509\" class=\"aligncenter size-full wp-image-38582\" \/><\/a><\/p>\n<p>If we had skipped the additional disk setup when we created the EC2 instance we would be stuck in the next step as now we need to tell which disk we will use as the cache:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_12.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_12.jpg\" alt=\"\" width=\"1000\" height=\"371\" class=\"aligncenter size-full wp-image-38585\" \/><\/a><br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_13.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_13.jpg\" alt=\"\" width=\"1000\" height=\"374\" class=\"aligncenter size-full wp-image-38586\" \/><\/a><\/p>\n<p>Logging should be enabled for production setups, we&#8217;ll skip it for this test and will go ahead and finally create the Storage Gateway:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_14.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_14.jpg\" alt=\"\" width=\"1000\" height=\"293\" class=\"aligncenter size-full wp-image-38587\" \/><\/a><br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_15.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_15.jpg\" alt=\"\" width=\"1000\" height=\"223\" class=\"aligncenter size-full wp-image-38588\" \/><\/a><\/p>\n<p>The Storage Gateway is now ready and we can go ahead and create a file share we can later mount on the PostgreSQL machine:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_16.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_16.jpg\" alt=\"\" width=\"1000\" height=\"260\" class=\"aligncenter size-full wp-image-38591\" \/><\/a><\/p>\n<p>As objects will go to S3 in the background you should have created a S3 bucket you can specify now and as PostgreSQL will be running on a Linux host we&#8217;ll go for NFS:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_17.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_17.jpg\" alt=\"\" width=\"1000\" height=\"413\" class=\"aligncenter size-full wp-image-38592\" \/><\/a><\/p>\n<p>Go with the defaults on the next screen:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_18.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_18.jpg\" alt=\"\" width=\"1000\" height=\"361\" class=\"aligncenter size-full wp-image-38593\" \/><\/a><\/p>\n<p>On the summary screen you should adjust the &#8220;Allowed clients&#8221; so only clients that you really know are safe to connect will be able to use the file share:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_19.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_19.jpg\" alt=\"\" width=\"1000\" height=\"582\" class=\"aligncenter size-full wp-image-38594\" \/><\/a><\/p>\n<p>Once the share is ready there will be examples on how you can mount the file share for various operating systems (these examples will show the private IP addresses):<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_20.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_20.jpg\" alt=\"\" width=\"1000\" height=\"376\" class=\"aligncenter size-full wp-image-38595\" \/><\/a><\/p>\n<p>Time to mount the file share on our local PostgreSQL machine:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@centos8pg:\/home\/postgres\/ [pgdev] sudo mkdir \/var\/tmp\/storageGateway\npostgres@centos8pg:\/home\/postgres\/ [pgdev] sudo mount -t nfs -o nolock,hard xxx.xxx.xxx.xxx:\/dwe-bucket-storage-gateway \/var\/tmp\/storageGateway\nostgres@centos8pg:\/home\/postgres\/ [pgdev] df -h | grep storageGateway\nxxx.xxx.xxx.xxx:\/dwe-bucket-storage-gateway  8.0E     0  8.0E   0% \/var\/tmp\/storageGateway\n<\/pre>\n<p>This can now be used to write your PostgreSQL backups to and all the files will go to S3 in the background:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@centos8pg:\/home\/postgres\/ [pgdev] mkdir \/var\/tmp\/storageGateway\/basebackup_20200327\npostgres@centos8pg:\/home\/postgres\/ [pgdev] pg_basebackup -D \/var\/tmp\/storageGateway\/basebackup_20200327\/\npostgres@centos8pg:\/home\/postgres\/ [pg13] ls -la \/var\/tmp\/storageGateway\/basebackup_20200327\/\ntotal 36\ndrwxr-xr-x. 1 postgres postgres     0 Mar 27 10:43 .\ndrwxrwxrwx. 1 nobody   nobody       0 Mar 27 10:41 ..\n-rw-------. 1 postgres postgres   224 Mar 27 10:41 backup_label\ndrwx------. 1 postgres postgres     0 Mar 27 10:42 base\n-rw-------. 1 postgres postgres    33 Mar 27 10:43 current_logfiles\ndrwx------. 1 postgres postgres     0 Mar 27 10:43 global\ndrwx------. 1 postgres postgres     0 Mar 27 10:41 pg_commit_ts\ndrwx------. 1 postgres postgres     0 Mar 27 10:41 pg_dynshmem\n-rw-------. 1 postgres postgres  4513 Mar 27 10:43 pg_hba.conf\n-rw-------. 1 postgres postgres  1636 Mar 27 10:43 pg_ident.conf\ndrwxr-xr-x. 1 postgres postgres     0 Mar 27 10:43 pg_log\ndrwx------. 1 postgres postgres     0 Mar 27 10:43 pg_logical\ndrwx------. 1 postgres postgres     0 Mar 27 10:41 pg_multixact\ndrwx------. 1 postgres postgres     0 Mar 27 10:41 pg_notify\ndrwx------. 1 postgres postgres     0 Mar 27 10:43 pg_replslot\ndrwx------. 1 postgres postgres     0 Mar 27 10:41 pg_serial\ndrwx------. 1 postgres postgres     0 Mar 27 10:41 pg_snapshots\ndrwx------. 1 postgres postgres     0 Mar 27 10:43 pg_stat\ndrwx------. 1 postgres postgres     0 Mar 27 10:43 pg_stat_tmp\ndrwx------. 1 postgres postgres     0 Mar 27 10:41 pg_subtrans\ndrwx------. 1 postgres postgres     0 Mar 27 10:43 pg_tblspc\ndrwx------. 1 postgres postgres     0 Mar 27 10:41 pg_twophase\n-rw-------. 1 postgres postgres     3 Mar 27 10:43 PG_VERSION\ndrwx------. 1 postgres postgres     0 Mar 27 10:43 pg_wal\ndrwx------. 1 postgres postgres     0 Mar 27 10:43 pg_xact\n-rw-------. 1 postgres postgres   252 Mar 27 10:43 postgresql.auto.conf\n-rw-------. 1 postgres postgres 27343 Mar 27 10:43 postgresql.conf\n<\/pre>\n<p>If you wait some time and then check the monitoring section of the Storage Gateway the various graphs should give you an idea what is happening:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_21.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_21.jpg\" alt=\"\" width=\"1000\" height=\"455\" class=\"aligncenter size-full wp-image-38597\" \/><\/a><\/p>\n<p>Checking the S3 bucket will also show you the files we have written to the Storage Gateway:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_22.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_22.jpg\" alt=\"\" width=\"1000\" height=\"673\" class=\"aligncenter size-full wp-image-38598\" \/><\/a><\/p>\n<p>Combine that with a backup solution like <a href=\"https:\/\/pgbackrest.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">pgBackRest<\/a>, <a href=\"https:\/\/www.pgbarman.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">barman<\/a>, <a href=\"https:\/\/www.enterprisedb.com\/enterprise-postgres\/edb-postgres-backup-and-recovery-tool\" target=\"_blank\" rel=\"noopener noreferrer\">EDB BART<\/a> or whatever you use and you have your PostgreSQL backups safely written offsite to S3.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the last post we had a quick look at AWS Kinesis data streams and how you can push data to AWS S3 using AWS Firehose. Another great AWS service is AWS Storage Gateway and in this post we&#8217;ll use that to push our PostgreSQL backups to AWS. The primary usage of AWS Storage Gateway&hellip;&nbsp;<\/p>\n","protected":false},"author":28,"featured_media":13819,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","neve_meta_reading_time":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[955,4133],"tags":[1885,1886],"class_list":["post-13818","post","type-post","status-publish","format-standard","has-post-thumbnail","category-cloud","category-database","tag-s3","tag-storage-gateway"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.9 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Using AWS Storage Gateway as a backup target for PostgreSQL - dbi services Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using AWS Storage Gateway as a backup target for PostgreSQL\" \/>\n<meta property=\"og:description\" content=\"In the last post we had a quick look at AWS Kinesis data streams and how you can push data to AWS S3 using AWS Firehose. Another great AWS service is AWS Storage Gateway and in this post we&#8217;ll use that to push our PostgreSQL backups to AWS. The primary usage of AWS Storage Gateway&hellip;&nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi services Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dbiservices\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-27T09:05:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"390\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Open source Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:site\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Open source Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\\\/\"},\"author\":{\"name\":\"Open source Team\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/0b4548362cac3eeff8b3eaf329e3530a\"},\"headline\":\"Using AWS Storage Gateway as a backup target for PostgreSQL\",\"datePublished\":\"2020-03-27T09:05:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\\\/\"},\"wordCount\":841,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/aws_sgw_1.jpg\",\"keywords\":[\"S3\",\"Storage Gateway\"],\"articleSection\":[\"Cloud\",\"Database\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\\\/\",\"name\":\"Using AWS Storage Gateway as a backup target for PostgreSQL - dbi services Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/aws_sgw_1.jpg\",\"datePublished\":\"2020-03-27T09:05:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/aws_sgw_1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/aws_sgw_1.jpg\",\"width\":1000,\"height\":390},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using AWS Storage Gateway as a backup target for PostgreSQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi services Blog\",\"description\":\"#BeSharing\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\",\"name\":\"dbi services\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"width\":512,\"height\":512,\"caption\":\"dbi services\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dbiservices\\\/\",\"https:\\\/\\\/x.com\\\/dbiservices\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dbi-services\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/dbiservices\"],\"description\":\"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.\",\"email\":\"info@dbi-services.com\",\"telephone\":\"+41 32 422 96 00\",\"legalName\":\"dbi services SA\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/0b4548362cac3eeff8b3eaf329e3530a\",\"name\":\"Open source Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/open-source-author.png\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/open-source-author.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/open-source-author.png\",\"caption\":\"Open source Team\"},\"description\":\"Posts published under the Open source Team account are collective contributions by the dbi services open infrastructure consultants. The practice covers open-source databases and platforms, PostgreSQL first of all, along with MySQL, MariaDB, and Linux, from architecture, replication, and high availability to performance tuning and operations under service level agreements, and contributes actively to the PostgreSQL community.\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/open-source-team\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Using AWS Storage Gateway as a backup target for PostgreSQL - dbi services Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/","og_locale":"en_US","og_type":"article","og_title":"Using AWS Storage Gateway as a backup target for PostgreSQL","og_description":"In the last post we had a quick look at AWS Kinesis data streams and how you can push data to AWS S3 using AWS Firehose. Another great AWS service is AWS Storage Gateway and in this post we&#8217;ll use that to push our PostgreSQL backups to AWS. The primary usage of AWS Storage Gateway&hellip;&nbsp;","og_url":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/","og_site_name":"dbi services Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2020-03-27T09:05:39+00:00","og_image":[{"width":1000,"height":390,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_1.jpg","type":"image\/jpeg"}],"author":"Open source Team","twitter_card":"summary_large_image","twitter_creator":"@dbiservices","twitter_site":"@dbiservices","twitter_misc":{"Written by":"Open source Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/"},"author":{"name":"Open source Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0b4548362cac3eeff8b3eaf329e3530a"},"headline":"Using AWS Storage Gateway as a backup target for PostgreSQL","datePublished":"2020-03-27T09:05:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/"},"wordCount":841,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_1.jpg","keywords":["S3","Storage Gateway"],"articleSection":["Cloud","Database"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/","url":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/","name":"Using AWS Storage Gateway as a backup target for PostgreSQL - dbi services Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_1.jpg","datePublished":"2020-03-27T09:05:39+00:00","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_1.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/aws_sgw_1.jpg","width":1000,"height":390},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Using AWS Storage Gateway as a backup target for PostgreSQL"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi services Blog","description":"#BeSharing","publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dbi-services.com\/#organization","name":"dbi services","url":"https:\/\/www.dbi-services.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","width":512,"height":512,"caption":"dbi services"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dbiservices\/","https:\/\/x.com\/dbiservices","https:\/\/www.linkedin.com\/company\/dbi-services\/","https:\/\/www.youtube.com\/user\/dbiservices"],"description":"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.","email":"info@dbi-services.com","telephone":"+41 32 422 96 00","legalName":"dbi services SA"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0b4548362cac3eeff8b3eaf329e3530a","name":"Open source Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/05\/open-source-author.png","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/05\/open-source-author.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/05\/open-source-author.png","caption":"Open source Team"},"description":"Posts published under the Open source Team account are collective contributions by the dbi services open infrastructure consultants. The practice covers open-source databases and platforms, PostgreSQL first of all, along with MySQL, MariaDB, and Linux, from architecture, replication, and high availability to performance tuning and operations under service level agreements, and contributes actively to the PostgreSQL community.","url":"https:\/\/www.dbi-services.com\/blog\/author\/open-source-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/13818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=13818"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/13818\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/13819"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=13818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=13818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=13818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}