Mô tả

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?

  • What is Second Level Sharding?

  • What is good Sharding?

  • How to query across multiple Shards?


How to setup High Availability (HA) on PostgreSQL?

  • Why High Availability?

  • Steps to achieve High Availability

  • Essential Questions to ask before setting-up High Availability

  • Log-Shipping Replication

  • Streaming Replication and Logical Replication

  • Cascading Replication

  • Synchronous vs. Asynchronous Replication

  • Automatic Failover and Always-on Strategy

  • Simple HA Solution Example

  • Better HA Solution Example


How to make use of PgPool II?

  • What is PgPool II?

  • Pgpool-II Features

  • How to Configure Pgpool-II with Streaming Replication? (Hands-on)

  • How to setup Streaming Replication? (Hands-on)

  • How to Configuring Pgpool-II for Load Balancing ? (Hands-on)

  • Testing load-balancing & read/write separation (Hands-on)

  • How to Configure Pgpool for PostgreSQL High-Availability? (Hands-on)

  • How to Configure PostgreSQL Primary Server? (Hands-on)

  • How to Configure Pgpool-II Server? (Hands-on)

  • How to Configure PostgreSQL Replica Server? (Hands-on)

  • Testing The Failover (Hands-on)

  • How to restore failed nodes? (Hands-on)



Bạn sẽ học được gì

Yêu cầu

Nội dung khoá học

9 sections

Scaling PostgreSQL

29 lectures
Why Scale PostgreSQL?
01:26
Quiz Why Scale PostgreSQL?
1 question
Vertical Scaling
01:13
Quiz Vertical Scaling
1 question
Horizontal Scaling
02:41
Horizontal Scaling
1 question
CAP Theorem Explained
03:48
PostgreSQL vs. NoSQL
01:59
Quiz PostgreSQL vs. NoSQL
1 question
Use case: Consistent and Available System
01:11
Quiz Use case: Consistent and Available System
1 question
Use case: Available and Partition-tolerant System
01:01
Quiz Use case: Available and Partition-tolerant System
1 question
Read Versus Write Bound Workload
02:45
Quiz Read Versus Write Bound Workload
1 question
How statistics will answer to all questions?
01:15
Quiz How statistics will answer to all questions?
1 question
Enable Statistics
04:40
Quiz Enable Statistics
1 question
Replication
01:27
Quiz Replication
1 question
Load Balancing
01:29
Connection Pooling
01:20
Quiz Connection Pooling
1 question
Queuing
00:53
Partitioning
00:37
Sharding
00:48
Quiz Sharding
1 question
Multi-master
01:45

Streaming Replication

10 lectures
What is Streaming Replication?
02:12
Asynchronous vs. Synchronous Replication
02:32
Quiz Asynchronous vs. Synchronous Replication
1 question
Hands-on - Initialise Primary Database
01:28
Hands-on - Initialise Primary Database
1 question
Configuring the Primary for Replication
03:46
Quiz Configuring the Primary for Replication
1 question
Configuring the Replica Instance
03:00
Quiz Configuring the Replica Instance
1 question
Testing Replication Setup
02:52

Logical Replication

13 lectures
What is Logical Replication in Postgres?
05:53
Quiz What is Logical Replication in Postgres?
1 question
Setting-up Postgres Servers for Logical Replication
04:44
Quiz Setting-up Postgres Servers for Logical Replication
1 question
Selective Copy of the Data
03:15
Quiz Selective Copy of the Data
1 question
Create the Publication
00:46
Create the Subscription
03:01
Quiz Create the Subscription
1 question
Limitations of Logical Replication
02:22
Quiz Limitations of Logical Replication
1 question
Monitoring Logical Replication
03:10
Best use-cases for Logical Replication
01:48

PgBouncer

14 lectures
Introduction
00:52
Quiz Introduction
1 question
Fundamental concepts of connection pooling
02:23
Quiz Fundamental concepts of connection pooling
1 question
Building a PgBouncer Setup
01:59
Quiz Building a PgBouncer Setup
1 question
Installing and Configure PgBouncer
00:37
Creating a basic configuration file for PgBouncer
03:15
Quiz Installing and Configure PgBouncer
1 question
Connecting to PgBouncer
01:13
Advanced Settings for Performance
02:55
Quiz Advanced Settings for Performance
2 questions
Pool Modes
01:51
A simple benchmark
03:57

Scaling PostgreSQL with Google Cloud and HAProxy

10 lectures
Introduction
00:26
Quiz Introduction
1 question
Key Components
00:37
Key Characteristics of the Architecture
00:57
Creating PostgreSQL Instances on Google Cloud
04:36
Quiz Creating PostgreSQL Instances on Google Cloud
1 question
Creating a GCE for HAProxy
03:59
Configure HAProxy for Load-Balancing
06:15
Quiz Configure HAProxy for Load-Balancing
2 questions
Testing Load-Balancing
03:49

Partitioning

10 lectures
Introduction
00:57
Quiz Introduction
1 question
Which Tables Need Partitioning?
02:06
Quiz Which Tables Need Partitioning?
1 question
How should the Tables be Partitioned?
01:47
Quiz How should the Tables be Partitioned?
1 question
Declarative vs. Inheritance Partitioning
00:44
Creating a Partitioned Table
04:22
Quiz Creating a Partitioned Table
1 question
Partitioning Methods
01:45

Sharding

9 lectures
Introduction
03:03
Quiz Introduction
1 question
Pain Points of Sharding
04:15
Quiz Pain Points of Sharding
1 question
How to Partition Data in PostgreSQL
03:23
Quiz How to Partition Data in PostgreSQL
2 questions
Second Level Sharding
02:05
Quiz Second Level Sharding
1 question
Querying Across Shards
01:38

PostgreSQL High Availability

14 lectures
Why High Availability?
00:38
Steps to achieve High Availability
01:56
Quiz Steps to achieve High Availability
1 question
Essential Questions to set-up High Availability
05:20
Log-Shipping Replication
01:23
Quiz Log-Shipping Replication
1 question
Streaming Replication and Logical Replication
02:30
Quiz Streaming Replication and Logical Replication
2 questions
Cascading Replication
01:16
Synchronous vs. Asynchronous Replication
02:04
Quiz Synchronous vs. Asynchronous Replication
1 question
Automatic Failover and Always-on Strategy
01:20
Simple HA Solution Example
00:51
Better HA Solution Example
01:41

PgPool II

18 lectures
Introduction
00:37
Pgpool-II Features
03:18
Quiz Pgpool-II Features
1 question
Configure Pgpool-II with Streaming Replication
01:07
Quiz Configure Pgpool-II with Streaming Replication
1 question
Setting up Streaming Replication
05:52
Configuring Pgpool-II for Load Balancing
06:41
Quiz Configuring Pgpool-II for Load Balancing
1 question
Testing load-balancing & read/write separation
03:24
Configure Pgpool for PostgreSQL High-Availability
00:57
Configuring PostgreSQL Primary Server
02:33
Quiz Configuring PostgreSQL Primary Server
2 questions
Configuring Pgpool-II Server
02:24
Configuring PostgreSQL Replica Server
01:23
Quiz Configuring PostgreSQL Replica Server
1 question
Testing The Failover
02:11
Restoring failed nodes
01:56
Quiz Restoring failed nodes
1 question

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.