This repository is intended to give a summarize notes of what i have learned and implement data replication in PostgreSQL. PostgreSQL WAL mechanism for further use.
To successfully simulate this data replication project, I highly appreciate the enthusiastic guilde from Marcel Dempers Github
In this repository, he will work us through the most basic tasks from docker setup and higher complex tasks such as change the config files in postgresql.
This is a mechanism that help to recover whenever our database crashes.
Suppose we have a backup version on Monday but the database crash on the following Saturday.
We do not have the backup version between the interval from tuesday to saturday, the WAL file will help us do this things.
In Window version, we can find the configs find in ‘.\PostgreSQL\16\data{intended file}’ path.
pg_hba.conf stands for host-based authentication file. It is like the postgres firewall configuration. It tell us which ip address or which user we can trust.
This allow us to map operating system user account to database user.
This is one of the critical configuration file that we should look into.
There is a hundreds line of document writing about this file but in this section we will focus on only a few parts.
- File location:
- We can manually direct where the data is stored by setting parameter data =”path to location”.
- Parameters**-hba_file** :This line points to the configuration file that controls how clients can connect to the PostgreSQL server. It defines which users or IP addresses are allowed to connect, and what authentication method they must use (e.g., password, MD5). This file is crucial for securing your database server.
- Parameters-ident_file: it point to the customer pg_ident.conf file.
- Connection and Authentication
This part include sections:
- Connection settings: we can config information suchas max-connections, suitable port number (5432 by default).
- TCP settings: tcp_keepalives_idle, tcp_keepalives_interval, tcp_keepalives_count, tcp_user_timeout.
- Authentication settings: the easiest information of this part is password_encryption technique, we can choose from various technique such as scram-sha-256, md5 and so on.
- Postgres Documentation
- The DevOps Guy Youtube: youtube chanel that help us understand more deeper about postgres, data replication and devops in general.