https://github.com/stephane-klein/postgresql-streaming-replication-playground
PostgreSQL 12 streaming replication playground
https://github.com/stephane-klein/postgresql-streaming-replication-playground
docker playground postgresql replication
Last synced: about 2 months ago
JSON representation
PostgreSQL 12 streaming replication playground
- Host: GitHub
- URL: https://github.com/stephane-klein/postgresql-streaming-replication-playground
- Owner: stephane-klein
- Created: 2020-04-26T09:04:51.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-26T12:57:53.000Z (about 6 years ago)
- Last Synced: 2025-08-12T16:36:31.606Z (11 months ago)
- Topics: docker, playground, postgresql, replication
- Language: Shell
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PostgreSQL 12 streaming replication playground
PostgreSQL 12 [streaming replication](https://www.postgresql.org/docs/12/warm-standby.html#STREAMING-REPLICATION) playground, based on this documentation: [PostgreSQL : la streaming replication en 12](https://blog.capdata.fr/index.php/postgresql-la-streaming-replication-en-12/)
```
$ ./scripts/generate-self-signed-certificate.sh
$ docker-compose up -d postgres1
$ ./scripts/wait-service.sh postgres1 5432
```
```
$ ./scripts/pg1/load-configuration.sh
$ ./scripts/pg1/load-seed.sh
$ ./scripts/pg1/insert-fixtures.sh
```
```
$ ./scripts/pg2/prepare.sh
```
```
$ docker-compose up -d postgres2
```
```
$ ./scripts/pg2/query.sh
count
-------
10
$ ./scripts/pg1/insert-fixtures.sh
$ ./scripts/pg2/query.sh
count
-------
20
```
Steaming replication limitations:
- It cannot perform selective replication or part of the database cannot be replicated.
- It cannot replicate between two different major versions.
- It cannot perform any writes in the standby server.
- It cannot replicate between different platforms (for example, Linux and Windows)
to go ahead this limitations, you can use PostgreSQL 12 logical replication.