I have been using replication slot since its birth in PostgreSQL 9.4 version. This feature is very helpful in terms of keeping the WAL files on master server to make sure that its replica servers are in good state and (a)sync with it. But, something horrible will happen if you left them inactive.
In one of our database clusters, the design was simply like this:
Both master and the replica was an instance with 8-core CPU and 32GB of RAM and the utilization was very low despite there are millions of read and write activities. With good queries and stable performance, we decided to replace the Replica #1 with another smaller server with 4-core CPU and 16GB of RAM. And so, the new Replica #2 is up and ready and now serving read queries. Continue reading “[PostgreSQL] Inactive Replication Slot: the Butterfly Effect”