PostGIS – Make a Database Copy Available to Customer

postgispostgresqlreplicationwindows-server

Our application uses a PostgreSQL database (with the PostGIS spatial extension). Now one of our customers has requested direct access to the database; because, as they claim, it’s their data.

We’d rather not provide direct access to the database, because a wrong query might end up killing (or temporarily disabling) the database server, resulting in downtime for our application, or even a corrupt database.

Instead, we were thinking of setting up a slave database, and replicate the master. The slave would then only be used for read-only querying, so doesn’t need to write back to the master.

What is the easiest method of doing this with Postgres, while working with PostGIS as well? Or is a daily data dump easier to accomplish?

Best Answer

If it's one time setup, I think dump would be easiest. But if You need your update be available on customer, then I think streaming replication would be easier, set up once and no need to update in the future as the replication will handle the data updates.

http://www.postgresql.org/docs/current/static/high-availability.html