Running on Docker, AWS with Data Stored on EBS - Mailing list pgsql-general

From Ryan Mahoney
Subject Running on Docker, AWS with Data Stored on EBS
Date
Msg-id BN6PR20MB12524283356FA4F4EB1D5EA68FA60@BN6PR20MB1252.namprd20.prod.outlook.com
Whole thread Raw
Responses Re: Running on Docker, AWS with Data Stored on EBS  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general

Hi All,


TL;TR: Can a new PostgreSQL process, running on a different server instance effectively resume operations by reading the same data directory location as another PostgreSQL process that is no longer running?


- - -


I have an application that is deployed to AWS as a docker container.  Although it is a single application, the container is running multiple services via supervisor.  One of those services is PostrgeSQL.


Currently I dump and reload the database between deployments, as each deployment completely destroys the server instance and creates a new one.


It is a small application without much data or usage load.


I'd like to store my data on a separate EBS volume.  Then, I was thinking that each time I perform a new deployment, I would attach the new server instance to the original EBS volume.


At any given moment, there would only ever be one PostgreSQL process attached to the data directory... but at any given time that would be a different process running on a different server.


I know that I can just test this out and see what happens, but I am concerned that even if it does appear to work at first, that it might still lead to some data corruption down the line if it is an incorrect strategy.


I have also considered using Amazon's hosted PostgreSQL service. While that would certainly work, I don't want to pay for an extra service, I'd like to use the most recent PostgreSQL version and I think my application will be faster if the data is served from the same instance.


If my application was larger, all of this would be moot because I'd run a dedicated PostgreSQL instance or just use RDS... but it isn't so I'd rather save money :)


Thanks in advance for your help,

Ryan

pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Gin indexes on intarray is fast when value in array does not exists, and slow, when value exists
Next
From: Karl Czajkowski
Date:
Subject: resolution order for foreign key actions?