{"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><!--more--><\/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\/sites\/2\/2022\/04\/aws_sgw_1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_3.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_4.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_5.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_6.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_7.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_8.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_9.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_10.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_11.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_12.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_13.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_14.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_15.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_16.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_17.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_18.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_19.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_20.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_21.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\/sites\/2\/2022\/04\/aws_sgw_22.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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;]<\/p>\n","protected":false},"author":29,"featured_media":13819,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[955,229],"tags":[133,135,77,1885,1886],"type_dbi":[],"class_list":["post-13818","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud","category-database-administration-monitoring","tag-aws","tag-cloud","tag-postgresql","tag-s3","tag-storage-gateway"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Using AWS Storage Gateway as a backup target for PostgreSQL - dbi 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;]\" \/>\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 Blog\" \/>\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\/sites\/2\/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=\"Daniel Westermann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@westermanndanie\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daniel Westermann\" \/>\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\":\"Daniel Westermann\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"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,\"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\/sites\/2\/2022\/04\/aws_sgw_1.jpg\",\"keywords\":[\"AWS\",\"Cloud\",\"PostgreSQL\",\"S3\",\"Storage Gateway\"],\"articleSection\":[\"Cloud\",\"Database Administration &amp; Monitoring\"],\"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 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\/sites\/2\/2022\/04\/aws_sgw_1.jpg\",\"datePublished\":\"2020-03-27T09:05:39+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"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\/sites\/2\/2022\/04\/aws_sgw_1.jpg\",\"contentUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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\":\"Accueil\",\"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 Blog\",\"description\":\"\",\"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\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\",\"name\":\"Daniel Westermann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"caption\":\"Daniel Westermann\"},\"description\":\"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.\",\"sameAs\":[\"https:\/\/x.com\/westermanndanie\"],\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/daniel-westermann\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Using AWS Storage Gateway as a backup target for PostgreSQL - dbi 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;]","og_url":"https:\/\/www.dbi-services.com\/blog\/using-aws-storage-gateway-as-a-backup-target-for-postgresql\/","og_site_name":"dbi Blog","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\/sites\/2\/2022\/04\/aws_sgw_1.jpg","type":"image\/jpeg"}],"author":"Daniel Westermann","twitter_card":"summary_large_image","twitter_creator":"@westermanndanie","twitter_misc":{"Written by":"Daniel Westermann","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":"Daniel Westermann","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"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,"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\/sites\/2\/2022\/04\/aws_sgw_1.jpg","keywords":["AWS","Cloud","PostgreSQL","S3","Storage Gateway"],"articleSection":["Cloud","Database Administration &amp; Monitoring"],"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 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\/sites\/2\/2022\/04\/aws_sgw_1.jpg","datePublished":"2020-03-27T09:05:39+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"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\/sites\/2\/2022\/04\/aws_sgw_1.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/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":"Accueil","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 Blog","description":"","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":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66","name":"Daniel Westermann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","caption":"Daniel Westermann"},"description":"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.","sameAs":["https:\/\/x.com\/westermanndanie"],"url":"https:\/\/www.dbi-services.com\/blog\/author\/daniel-westermann\/"}]}},"_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\/29"}],"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"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=13818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}