PostgreSQL supports built-in streaming replication for high availability.
# On primary — postgresql.conf
wal_level = replica
max_wal_senders = 3
# On replica
primary_conninfo = 'host=primary port=5432 user=replicator'
# Create replication user
CREATE ROLE replicator REPLICATION LOGIN PASSWORD 'secret';