Skip to content

Commit 42fb7a7

Browse files
committed
Update README.md
1 parent 9f10e5f commit 42fb7a7

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

README.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
A PostgreSQL streaming logical replication client for Haskell.
44

5+
React to database changes in real-time.
6+
57
This library is currently _EXPERIMENTAL_ and is not ready for
68
production yet. Developers are encouraged to test out the library,
79
add issues, contribute and make it awesome.
810

9-
React to database changes in real-time. Enrich data, send
10-
notifications, monitor suspicious activity, etc.
11-
1211
## Setup
1312

1413
In order to use a logical replication client you need to set the
@@ -17,13 +16,6 @@ in your `postgres.conf` file:
1716

1817
wal_level = logical
1918

20-
There is a known issue in the experimental release where the
21-
`wal_sender` process, if it has a timeout set, will time out a
22-
replicant client. This will be fixed in a future release. Unless
23-
you're trying to fix it, you can turn it off by setting:
24-
25-
wal_sender_timeout = 0
26-
2719
Then restart your server, log in as `postgres` or another super user
2820
and check:
2921

@@ -36,7 +28,7 @@ You will also need a user who is
3628
"PostgreSQL user role documentation") to use replication features.
3729

3830
Then add a database and your user with the `REPLICATION` trait to the
39-
database, grant all on it if you need to, etc.
31+
database, grant all on it if you need to.
4032

4133
We haven't added authorization support yet to the library so make sure
4234
in `pg_hba.conf` you `trust` local connections:
@@ -46,8 +38,7 @@ in `pg_hba.conf` you `trust` local connections:
4638
Caveat emptor.
4739

4840
You will also need to install the `wal2json` plugin for your
49-
PostgreSQL server. For example in Ubuntu-like distributions you can
50-
just:
41+
PostgreSQL server. For example in Ubuntu-like distributions you can:
5142

5243
$ sudo apt install postgresql-12-wal2json
5344

@@ -107,4 +98,18 @@ The configuration settings are:
10798
You don't have to set up triggers for each table with logical
10899
replication. You also don't have the message size limitation. That
109100
limitation often forces clients to perform a query for each message to
110-
fetch the data. We only use one connection.
101+
fetch the data and can use more than one connection. We only use one
102+
connection.
103+
104+
### What are the trade offs?
105+
106+
This library uses logical replication slots. If your program loses
107+
the connection to the database and cannot reconnect the server will
108+
hold onto WAL files until your program can reconnect and resume the
109+
replication stream. On a busy database, depending on your
110+
configuration, this can eat up disk space quickly.
111+
112+
It's a good idea to monitor your replication slots. If
113+
`postgresql-replicant` cannot reconnect to the slot and resume the
114+
stream you may need to have a strategy for dropping the slot and
115+
recreating it once conditions return to normal. Have a strategy.

0 commit comments

Comments
 (0)