PostgreSQL Replication, High Availability HA and Scalability (Udemy.com)
Solutions for Scaling Postgres with Master-Slave Replication, PgBouncer, PgPool II, HAProxy, Partitioning, Sharding
Created by: Lucian Oprea
Last updated January 2025
What you will learn
- Assess your scaling needs
- How to scale reads using Replication and Load-Balancing
- Which is the best Replication solution for a certain use case
- How to manage database connections with PgBouncer connection pooler
- How to make use of multiple PostgreSQL instances in the cloud (Google Cloud)
- How to achieve High-Availability
- How to perform Automatic Failover using PgPool II
- How to scale writes using Partitioning and Sharding
How it compares
Against the other 47 rated Udemy courses in PostgreSQL on CourseDuck:
- Rating4.4 out of 5higher than 57% of them
- Reviews452#16 of 48 by number of reviews
- Length3.1 hoursshorter than 68% of them
- Last updatedJanuary 2025more recently than 55% of them
Course Description
PostgreSQL is one of the most powerful and easy-to-use database management systems. It has strong support from the community and is being actively developed with a new release every year.
PostgreSQL supports the most advanced features included in SQL standards. It also provides NoSQL capabilities and very rich data types and extensions. All of this makes PostgreSQL a very attractive solution in software systems.
In this course, we discussed the problem of building scalable solutions based on PostgreSQL utilizing the resources of several servers. There is a natural limitation for such systems—basically, there is always a compromise between performance, reliability, and consistency. It's possible to improve one aspect, but others will suffer. In this course, we'll see how to find the best match for our use-cases so that we know eactly which aspects need scaling, and avoid the common trade-offs of distributed systems.
Scaling PostgreSQL is a journey. You should come out of this course more prepared to assess your scaling needs and understand how to scale reads and how to scale writes.
Each of this solution presented in this course will improve some aspect of the scalability topic, but each of them will add some complexity, and maybe some limitation or constraint.
We have to ask the right questions to get the system requirements, and this why we dedicated an entire lecture, so that we examine what questions we have to put ourself, before starting the Scaling Journey.
After this course, we should come out more prepared and understand how to scale reads.
We have several options for replication, depending on wether we favor performance or flexibility.
Replication can be used as a backup or a standby solution that would take over in case the main server crashes.
Replication can also be used to improve the performance of a software system by making it possible to distribute the load on several database servers.
Then, if we have one sort of replication in place, we could ask ourself if we want to allow several computers to serve the same data.
To achieve this, we should have a mechanism to distribute the requests. We’ll see here two of the most popular options available.
Next, if the number of database connections is great, then we’ll probably want to use a connection pooler. Again, we’ll cover two options here.
We’ll also see, how to scale writes, and how to make your traffic growth more predictable by adding queuing to your architecture.
Then, we’ll check partitioning for those cases when we have to deal with big tables.
Also, we’ll check sharding to scale writes, and all the complex decisions that come with it.
Finally, we’ll see shortly the multi-master solution, which is a relatively new concept that seems to be promising.
If our goal is to achieve only High availability, or the ability to continue working even in the situation where one part of the cluster fails, we can check out only those solutions.
The pre-requirements for HA is to put in place a replication strategy.
Then, we can use tools to allow a second server to take over quickly, if the primary server fails.
Introduction to Scaling PostgreSQL
Why scale PostgreSQL?
What is Vertical Scaling?
What is Horizontal Scaling?
Read Versus Write Bound Workloads
Why Statistics are essential?
How to enable and make us of Statistics? (Hands-on)
How to scale Postgres for Reads?
How replication helps to scale out?
What are the Load-Balancers?
How to scale Postgres for Writes?
How to make use of Queues?
How could Partitioning and Sharding help in scaling out?
What is the Multi-Master solution about?
Understanding the Limitations of Scaling out PostgreSQL
CAP Theorem Explained
PostgreSQL vs. Cassandra
Use case: CA Systems
Use case: AP Systems
How to use Streaming Replication?
What is Streaming Replication?
Asynchronous vs. Synchronous Replication
How to Initialise Primary Database? (Hands-on)
How to Configuring the Primary for Replication? (Hands-on)
How to Configuring the Replica Instance? (Hands-on)
Testing Replication Setup (Hands-on)
How to use Logical Replication?
What is Logical Replication in Postgres?
Step by step Logical Replication setup
How to setup the servers for Logical Replication? (Hands-on)
How to make a selective Copy of the Data? (Hands-on)
How to Create the Publication? (Hands-on)
How to Create the Subscription? (Hands-on)
Postgres Limitations of Logical Replication
How to Monitoring Logical Replication? (Hands-on)
Best use-cases for using Logical Replication
How to make use of PgBouncer?
What is PgBouncer?
Fundamental concepts of connection pooling
How to build a PgBouncer Setup? (Hands-on)
How to install and configure PgBouncer? (Hands-on)
How to create a basic configuration file for PgBouncer? (Hands-on)
How to connect to PgBouncer? (Hands-on)
Explaining Advanced Settings for Performance
Which are the available Pool Modes?
Executing a benchmark with PgBouncer (Hands-on)
How to scale PostgreSQL in Google Cloud?
Introduction
Key Components on Google Cloud
Key Characteristics of the Architecture
How to create PostgreSQL Instances on Google Cloud? (Hands-on)
How to create a Google Cloud Engine (GCE) for HAProxy? (Hands-on)
How to configure HAProxy for Load-Balancing? (Hands-on)
Testing Load-Balancing
How to make use of PostgreSQL Partitioning?
What is Partitioning?
Which Tables Need Partitioning?
How should the Tables be Partitioned?
Declarative vs. Inheritance Partitioning
How to create a Partitioned Table? (Hands-on)
Partitioning Methods
How to Shard PostgreSQL?
What is Sharding?
Pain-Points of Sharding?
Instructor Details
- 4.4 Rating
452 Reviews
Lucian Oprea
I’m a backend software engineer and instructor from Romania with more than 14 years of professional experience. I focus on system design, databases, APIs, performance, and the practical trade-offs behind reliable software. More than 19,000 Udemy students have enrolled in my courses, and I share backend engineering lessons with a community of more than 60,000 YouTube subscribers. My teaching is concise, visual, and grounded in real engineering decisions—not memorized diagrams. I aim to help developers understand why a solution works, compare realistic alternatives, and explain their choices with confidence.
More courses by Lucian Oprea
PostgreSQL High Performance Tuning Guide (2026)
4.1 (1,588 Reviews)
Provider: Udemy
Time: 2.7h
$64.99
More PostgreSQL courses
The Complete SQL Bootcamp: Go from Zero to Hero (2022)
4.7 (258,007 Reviews)
Provider: Udemy
Time: 8.9h
$159.99
SQL and PostgreSQL: The Complete Developer's Guide (2026)
4.7 (13,224 Reviews)
Provider: Udemy
Time: 22.2h
$139.99
SQL & Database Design A-Z™: Learn MS SQL Server + PostgreSQL (2025)
4.7 (5,426 Reviews)
Provider: Udemy
Time: 12.7h
$15.99
Zero to Hero in SQL: SQL for Data Analytics (2026)
4.6 (14,123 Reviews)
Provider: Udemy
Time: 10.4h
$129.99
SQL and PostgreSQL for Beginners: Become a SQL Expert (2026)
4.6 (8,732 Reviews)
Provider: Udemy
Time: 12.3h
$139.99
PostgreSQL Database Administration on Windows/Linux- Part 1 (2025)
4.6 (7,007 Reviews)
Provider: Udemy
Time: 14.3h
$74.99
Reviews
By Aner Jose Bautista Bonilla on 5/29/2026
Me gusta que habla de cosas internas y algunos problemas de cada tipo de replicacion. tambien me gusta que es bastante resumido pero sin perder el principio. ah! y el fondo oscuro... mis ojos lo agradecen!
By Kerian Amin Ngu on 9/25/2025
Thank you for such an insightful three hour session on scaling PostgreSQL. The way you explained the theory made it very clear, and the hands-on exercises, though short, were practical and effective. You touched on all the key areas' master-slave replication, pgPulsar, Pgpool-II, HA proxy, partitioning, and sharding, and highlighted the important aspects of each. The flow was seamless, easy to follow, and I truly appreciate the effort you put into making the concepts well understood.
By Damion Reeves on 12/12/2024
Commands shown in all lessons were very basic, the PostgreSQL databases were tiny and ran on the same physical machine, so weren't indicative of real-world databases (and thus didn't experience things like network lag/disruptions that affect Primary and Secondary/Standby Nodes). The "Restoring Failed Nodes" lesson was a waste of time as it didn't actually contain any of the steps showing how pgpool and pg_rewind were used to restore the failed Primary Node. For an "Intermediate Level" course I was expecting far more detail in the entire course.
By Muhammad iqbal on 11/10/2024
This course provided an in-depth look at setting up PostgreSQL replication and ensuring high availability, which is exactly what I needed for our production setup. The instructor covered various replication methods and failover techniques clearly, and the hands-on demonstrations made it easy to follow along.
By Gernot Ruban on 2/1/2024
Short and to the point! In just 3 hours a very good, practice-oriented introduction to the most important tools with demonstrations in each section. An accompanying script document would be the icing on the cake.
By Motsoaledi Neo Tshoana on 3/22/2023
A lot of concepts are being explained. You'll only get one example of each so if you really want to understand, you're going to have to have your own practice examples multiple times. It would be nice if sample code was also made available to download.
By Gianpio Mancarella on 2/25/2023
Corso molto chiaro ed esaustivo, ho molto apprezzato le slide animate che a colpo d'occhio chiariscono il concetto trattato. Eccezionale la parte pratica con tutti i comandi da eseguire per mettere in atto quanto illustrato sull'argomento.
By Rishabh Mishra on 2/16/2023
I recently completed a course on PostgreSQL Replication, High Availability HA and Scalability, and while I appreciate the effort you put into creating the content, I have to say that I was disappointed with the level of detail provided. The video was more of an overview than an in-depth exploration of the topic. As a viewer, I was hoping to gain a deeper understanding of the subject matter, but I found that the video only scratched the surface. It would have been helpful if you had gone into more detail, provided examples, or shared more insights to help me fully understand the topic. Going forward, I would suggest that you consider delving deeper into the topics you cover in your videos. Your audience will appreciate a more comprehensive explanation, and it will also help to differentiate your content from others in your field. Thank you for your hard work and dedication to creating informative videos.
By Safi'ee Madian on 12/6/2022
Very detail explanation and demonstration on implementing High Availability of PostgreSQL database. All demonstration is work on our own machine whether is single machine or multiple server. But it also good if it demonstrate the HA Proxy implementation without using Google Cloud because we want to see how its implement on Premise environment.
By Fernando Solar Sanchez on 10/10/2022
It is great as a practical course because you can go along and doing the practices with the instructor or just receiving the information fast. Also the way the units are split favors advancing quickly. I am using it to prepare for a work interview.
Quality Score
No CourseDuck member has rated this course yet. Taken it? Give each part a thumbs up or down.
Overall Score : 88 / 100









