SlideShare a Scribd company logo
Patroni-based citus high availability
environment deployment
( 基于Patroni的Citus高可用环境部署 )
PGDay.Seoul & PGConf.Asia 2021
Daniel Lee
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 1
About Me
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 2
• Dainel lee ( 李炯彩 )
• Community
• MySQL Korea User Group
• facebook.com/groups/mysqlko
• PostgreSQL Korea
• facebook.com/groups/130019777169719
• Github
• github.com/dbdbdeep-git/pgday-seoul-2021-demo
Agenda
1. Service Discovery ( *Service Mesh )
• CoreOS’s ETCD
• Hashicorp’s Consul
2. Dynamic Configuration Management
• ConfD
• Hashicorp’s Consul-Template
3. High-Availability
• Zalando’s Patroni
4. Distributed PostgreSQL as an extension
• Citusdata’s Citus
5. Demo
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 3
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 4
1. Service Discovery
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 5
What is …
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 6
Lock
Service
(chubby)
Coordination
Service
(zookeeper,eureka,etcd)
Service Discovery
(surf,skydns,consul)
Service Mesh
(lstio,linkerd2)
What can you do with Consul?
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 7
Service Discovery
for connectivity
Service Registry enables services to
register and discover each other.
Service Segmentation
for security
Secure service-to-service communication
with automatic TLS encryption and
identity-based authorization.
Service Configuration
for runtime configuration
Feature rich Key/Value store to easily
configure services.
What can you do with Consul?
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 8
Consul-Kubernetes Deployments
Use Consul service discovery and
service mesh features with Kubernetes.
Secure Service Communication
Secure and observe communication between
your services without modifying their code.
Dynamic Load Balancing
Automate load balancer configuration with
Consul and HAProxy, Nginx, or F5.
3 Marine Admirals
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 9
Properties Consul Etcd Zookeeper
User Interface Available X X
RPC Available Available
Health Check HTTP API HTTP API TCP
Key Value
3 Consistency modes
(sync)
Good Consistency
(semi)
Strong Consistency
Token System Available X X
Language Golang Golang Java
Security ACL / HTTPS HTTPS ACL
Spring Cloud O O O
Multi
Datacenter(gossip)
O X X
2. Dynamic Configuration
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 10
ConfD
• http://www.confd.io
• Manage local application configuration files using templates and
data from etcd or consul
• A lightweight configuration management tool focused on:
• keeping local configuration files up-to-date using data stored in etcd,
consul, dynamodb, redis, vault, zookeeper, aws ssm parameter store or
env vars and processing template resources.
• reloading applications to pick up new config file changes
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 11
ConfD or Consul-template Architecture
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 12
ETCD or Consul
Server
Confd or
Consul-template
Service
Application
(HAproxy, PostgreSQL)
Configuration
Template
File
Application
Configuration
File
listen
generate
haproxy.cfg.tmpl haproxy.cfg
reload
check
reload
update
PostgreSQL Client authentication
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 13
Consul Server
Consul-template
Service
Postgres Server
Configuration
Template
File
Application
Configuration
File
listen
generate
pg_hba.conf.tmpl pg_hba.conf
reload
check
reload
update
$ consul kv put
service/database/primary/auth/client
“host all haproxy 10.0.1.0/24 reject”
3. Zalando’s Patroni
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 14
Zalando Company
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 15
’s Patroni
• Patroni is a template for you to create your own customized, high-availability solution using
Python and - for maximum accessibility - a DCS (Distributed Configuration Store)
like ZooKeeper, etcd, Consul or Kubernetes.
• Currently supported PostgreSQL versions: 9.3 to 14.
• Release lastest 2.1.1 ( 09.11.21 )
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 16
’s Spilo
• Spilo is a Docker image that provides PostgreSQL and Patroni bundled
together. Patroni is a template for PostgreSQL HA. Multiple Spilos can create
a resilient High Available PostgreSQL cluster. For this, you'll need to start all
participating Spilos with identical etcd addresses and cluster names.
• https://github.com/zalando/spilo
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 17
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 18
Raft : DC to DC
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 19
HA : Patroni vs pg_auto_failover
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 20
4. Citusdata’s Citus
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 21
Hyperscale (Citus) on Azure Database for PostgreSQL
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 22
Citusとは? by Noriyoshi Shinoda
• PostgreSQL でスケールアウト環境を実現
• 複数ノードにまたがったパラレル・クエリーとパーティショニング機能
• スループット拡大を目指す
• PostgreSQL の拡張(EXTENSION)として実装
• PostgreSQL 本体の変更なし
• Citus Data (https://www.citusdata.com/)が開発
• 2019年1月 Microsoft による買収
• Azure Database for PostgreSQL - Hyperscale (Citus) の中核技術となっている
• オープンソース版も提供(https://github.com/citusdata/citus)
• 以下の機能は含まない
• 自動フェイルオーバー
• 自動データ・リバランス
• バックアップ等の運用機能
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 23
https://www.slideshare.net/noriyoshishinoda/postgresql-conference-japan-2021-b2-citus-10
Citus 란?
• PostgreSQL로 스케일 아웃 환경 실현
• 다중 노드에 걸친 병렬 쿼리 및 파티셔닝 기능
• 처리량 확대를 목표로
• PostgreSQL 확장(EXTENSION)으로 구현
• PostgreSQL 본체 변경 없음
• Citus Data (https://www.citusdata.com/) 개발
• 2019년 1월 Microsoft에서 인수
• Azure Database for PostgreSQL - Hyperscale (Citus)의 핵심 기술입니다.
• 오픈 소스 버전도 제공 (https://github.com/citusdata/citus)
• 다음 기능은 포함되지 않음
• 자동 장애 조치
• 자동 데이터 재조정
• 백업 등의 운용 기능
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 24
What is Citus ?
• Achieve a scale-out environment with PostgreSQL
• Parallel query and partitioning capabilities across multiple nodes
• Aim to increase throughput
• Implemented as an extension of PostgreSQL (EXTENSION)
• No changes to PostgreSQL itself
• Developed by Citus Data (https://www.citusdata.com/)
• Acquired by Microsoft in January 2019
• Azure Database for PostgreSQL-is the core technology of Hyperscale (Citus)
• Open source version is also available (https://github.com/citusdata/citus)
• The following functions are not included
• Automatic failover
• Automatic data rebalancing
• Operational functions such as backup
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 25
What is Citus ? by Noriyoshi Shinoda
Instance configuration
• Coordinator Node
• A PostgreSQL instance that accepts connections from clients
• Manage metadata
• Worker Node
• PostgreSQL instance that actually stores the data
• No communication between Worker Nodes
• Install citus EXTENSION on all nodes
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 26
What is Citus ? by Noriyoshi Shinoda
Instance configuration
• Processing performed by Coordinator Node
• Accepting connections from clients
• Final sort (ORDER BY)
• Sequence processing (including SERIAL column and GENERATED AS
IDENTITY column)
• Handling objects other than tables and indexes
• Processing executed by Worker Node
• Processing SQL statements requested by Coordinator Node
• Execution of ANALYZE statement
• Execution of VACUUM statement
• Retaining table data
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 27
CREATE EXTENSION citus;
• Add nodes:
postgres=> SELECT master_add_node(‘worker-01_ip_or_dns’, 5432);
Postgres=> SELECT master_add_node(’worker-02_ip_or_dns’, 5432);
• Create distributed table:
postgres=> CREATE TABLE events ( orders_id int, ... );
postgres=> SELECT create_distributed_table( ‘orders', ‘orders_id’ );
• Events is now distributed across shards on the nodes
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 28
if(kakao) 2021
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 29
https://if.kakao.com/session/59
Table structure by Noriyoshi Shinoda
Distributed table
• A table that distributes and stores data
• Suitable for fact tables
• Specify a column as the distribution key
(default determines the distribution destination table by the hash value range)
• The number of divisions can be specified
• citus.shard_count (default value 32)
• Replicas can be created on different Worker Nodes
• citus.shard_replication_factor (default value 1 = no replica)
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 30
Table structure by Noriyoshi Shinoda
Distributed table
• Table created in worker Node
• For the table name, ShardID is added to the original table name.
• If a replica is specified, a table with the same name will be created in a different Worker Node.
• Same data is stored in the table with the same name
• Search the citus_shards catalog to see the table names created by the Worker Node
postgres=> SET citus.shard_count = 6 ;
postgres=> SET citus.shard_replication_factor = 2 ;
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 31
Coordinator Worker#1 Worker#2 Worker#3
Dist1
dist1_102046 dist1_102046
dist1_102047 dist1_102047
dist1_102048 dist1_102048
dist1_102049 dist1_102049
dist1_102050 dist1_102050
dist1_102051 dist1_102051
Demo | Skip
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 32
if(kakao) 2021
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 33
Q?!A
2021-11-24 PGDay.Seoul & PGConf.Asia 2021 34

More Related Content

What's hot

High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando Patroni
Zalando Technology
 
Introduction to Vacuum Freezing and XID
Introduction to Vacuum Freezing and XIDIntroduction to Vacuum Freezing and XID
Introduction to Vacuum Freezing and XID
PGConf APAC
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System Administrators
Command Prompt., Inc
 
PostgreSQL Deep Internal
PostgreSQL Deep InternalPostgreSQL Deep Internal
PostgreSQL Deep Internal
EXEM
 
Postgresql Database Administration- Day3
Postgresql Database Administration- Day3Postgresql Database Administration- Day3
Postgresql Database Administration- Day3
PoguttuezhiniVP
 
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
PgDay.Seoul
 
Postgresql
PostgresqlPostgresql
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
metsarin
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?
Mydbops
 
Meet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike Steenbergen
Meet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike SteenbergenMeet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike Steenbergen
Meet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike Steenbergen
distributed matters
 
EDB Postgres DBA Best Practices
EDB Postgres DBA Best PracticesEDB Postgres DBA Best Practices
EDB Postgres DBA Best Practices
EDB
 
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
PgDay.Seoul
 
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
PgDay.Seoul
 
PostgreSQL Tutorial for Beginners | Edureka
PostgreSQL Tutorial for Beginners | EdurekaPostgreSQL Tutorial for Beginners | Edureka
PostgreSQL Tutorial for Beginners | Edureka
Edureka!
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performance
PostgreSQL-Consulting
 
PostgreSQL- An Introduction
PostgreSQL- An IntroductionPostgreSQL- An Introduction
PostgreSQL- An Introduction
Smita Prasad
 
Get to know PostgreSQL!
Get to know PostgreSQL!Get to know PostgreSQL!
Get to know PostgreSQL!
Oddbjørn Steffensen
 
PostgreSQL Performance Tuning
PostgreSQL Performance TuningPostgreSQL Performance Tuning
PostgreSQL Performance Tuningelliando dias
 
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
PgDay.Seoul
 

What's hot (20)

High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando Patroni
 
Introduction to Vacuum Freezing and XID
Introduction to Vacuum Freezing and XIDIntroduction to Vacuum Freezing and XID
Introduction to Vacuum Freezing and XID
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System Administrators
 
PostgreSQL Deep Internal
PostgreSQL Deep InternalPostgreSQL Deep Internal
PostgreSQL Deep Internal
 
Postgresql Database Administration- Day3
Postgresql Database Administration- Day3Postgresql Database Administration- Day3
Postgresql Database Administration- Day3
 
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
 
Postgresql
PostgresqlPostgresql
Postgresql
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?
 
Meet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike Steenbergen
Meet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike SteenbergenMeet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike Steenbergen
Meet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike Steenbergen
 
EDB Postgres DBA Best Practices
EDB Postgres DBA Best PracticesEDB Postgres DBA Best Practices
EDB Postgres DBA Best Practices
 
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
 
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
 
PostgreSQL Tutorial for Beginners | Edureka
PostgreSQL Tutorial for Beginners | EdurekaPostgreSQL Tutorial for Beginners | Edureka
PostgreSQL Tutorial for Beginners | Edureka
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performance
 
PostgreSQL- An Introduction
PostgreSQL- An IntroductionPostgreSQL- An Introduction
PostgreSQL- An Introduction
 
Get to know PostgreSQL!
Get to know PostgreSQL!Get to know PostgreSQL!
Get to know PostgreSQL!
 
PostgreSQL Performance Tuning
PostgreSQL Performance TuningPostgreSQL Performance Tuning
PostgreSQL Performance Tuning
 
Backup and-recovery2
Backup and-recovery2Backup and-recovery2
Backup and-recovery2
 
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
 

Similar to patroni-based citrus high availability environment deployment

Operating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with KubernetesOperating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with Kubernetes
Jonathan Katz
 
Le novità di SQL Server 2022
Le novità di SQL Server 2022Le novità di SQL Server 2022
Le novità di SQL Server 2022
Gianluca Hotz
 
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
FIWARE
 
Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...
Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...
Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...
MongoDB
 
Time series Analytics - a deep dive into ADX Azure Data Explorer @Data Saturd...
Time series Analytics - a deep dive into ADX Azure Data Explorer @Data Saturd...Time series Analytics - a deep dive into ADX Azure Data Explorer @Data Saturd...
Time series Analytics - a deep dive into ADX Azure Data Explorer @Data Saturd...
Riccardo Zamana
 
Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...
Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...
Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...
MongoDB
 
Using PostgreSQL With Docker & Kubernetes - July 2018
Using PostgreSQL With Docker & Kubernetes - July 2018Using PostgreSQL With Docker & Kubernetes - July 2018
Using PostgreSQL With Docker & Kubernetes - July 2018
Jonathan Katz
 
Enterprise guide to building a Data Mesh
Enterprise guide to building a Data MeshEnterprise guide to building a Data Mesh
Enterprise guide to building a Data Mesh
Sion Smith
 
SQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database ProjectsSQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database Projects
floydhilton
 
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on KubernetesApache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
DataWorks Summit
 
20210427 azure lille_meetup_azure_data_stack
20210427 azure lille_meetup_azure_data_stack20210427 azure lille_meetup_azure_data_stack
20210427 azure lille_meetup_azure_data_stack
Alexandre BERGERE
 
Implementing a build manager in Ada
Implementing a build manager in AdaImplementing a build manager in Ada
Implementing a build manager in Ada
Stephane Carrez
 
GlobusWorld 2021 Tutorial: Globus for System Administrators
GlobusWorld 2021 Tutorial: Globus for System AdministratorsGlobusWorld 2021 Tutorial: Globus for System Administrators
GlobusWorld 2021 Tutorial: Globus for System Administrators
Globus
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
Teamstudio
 
TDC2016POA | Trilha Cloud Computing - Microsoft Azure ? From Zero To Hero!
TDC2016POA | Trilha Cloud Computing - Microsoft Azure ? From Zero To Hero!TDC2016POA | Trilha Cloud Computing - Microsoft Azure ? From Zero To Hero!
TDC2016POA | Trilha Cloud Computing - Microsoft Azure ? From Zero To Hero!
tdc-globalcode
 
[SSA] 03.newsql database (2014.02.05)
[SSA] 03.newsql database (2014.02.05)[SSA] 03.newsql database (2014.02.05)
[SSA] 03.newsql database (2014.02.05)Steve Min
 
MySQL 5.7 New Features for Developers
MySQL 5.7 New Features for DevelopersMySQL 5.7 New Features for Developers
MySQL 5.7 New Features for Developers
Zohar Elkayam
 
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKSPostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
Carlos Andrés García
 
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKSPostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
VMware Tanzu
 
Geek Sync | Deployment and Management of Complex Azure Environments
Geek Sync | Deployment and Management of Complex Azure EnvironmentsGeek Sync | Deployment and Management of Complex Azure Environments
Geek Sync | Deployment and Management of Complex Azure Environments
IDERA Software
 

Similar to patroni-based citrus high availability environment deployment (20)

Operating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with KubernetesOperating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with Kubernetes
 
Le novità di SQL Server 2022
Le novità di SQL Server 2022Le novità di SQL Server 2022
Le novità di SQL Server 2022
 
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
 
Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...
Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...
Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...
 
Time series Analytics - a deep dive into ADX Azure Data Explorer @Data Saturd...
Time series Analytics - a deep dive into ADX Azure Data Explorer @Data Saturd...Time series Analytics - a deep dive into ADX Azure Data Explorer @Data Saturd...
Time series Analytics - a deep dive into ADX Azure Data Explorer @Data Saturd...
 
Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...
Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...
Lightning Talk: Why and How to Integrate MongoDB and NoSQL into Hadoop Big Da...
 
Using PostgreSQL With Docker & Kubernetes - July 2018
Using PostgreSQL With Docker & Kubernetes - July 2018Using PostgreSQL With Docker & Kubernetes - July 2018
Using PostgreSQL With Docker & Kubernetes - July 2018
 
Enterprise guide to building a Data Mesh
Enterprise guide to building a Data MeshEnterprise guide to building a Data Mesh
Enterprise guide to building a Data Mesh
 
SQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database ProjectsSQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database Projects
 
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on KubernetesApache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
 
20210427 azure lille_meetup_azure_data_stack
20210427 azure lille_meetup_azure_data_stack20210427 azure lille_meetup_azure_data_stack
20210427 azure lille_meetup_azure_data_stack
 
Implementing a build manager in Ada
Implementing a build manager in AdaImplementing a build manager in Ada
Implementing a build manager in Ada
 
GlobusWorld 2021 Tutorial: Globus for System Administrators
GlobusWorld 2021 Tutorial: Globus for System AdministratorsGlobusWorld 2021 Tutorial: Globus for System Administrators
GlobusWorld 2021 Tutorial: Globus for System Administrators
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
 
TDC2016POA | Trilha Cloud Computing - Microsoft Azure ? From Zero To Hero!
TDC2016POA | Trilha Cloud Computing - Microsoft Azure ? From Zero To Hero!TDC2016POA | Trilha Cloud Computing - Microsoft Azure ? From Zero To Hero!
TDC2016POA | Trilha Cloud Computing - Microsoft Azure ? From Zero To Hero!
 
[SSA] 03.newsql database (2014.02.05)
[SSA] 03.newsql database (2014.02.05)[SSA] 03.newsql database (2014.02.05)
[SSA] 03.newsql database (2014.02.05)
 
MySQL 5.7 New Features for Developers
MySQL 5.7 New Features for DevelopersMySQL 5.7 New Features for Developers
MySQL 5.7 New Features for Developers
 
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKSPostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
 
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKSPostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
PostgreSQL-as-a-Service with Crunchy PostgreSQL for PKS
 
Geek Sync | Deployment and Management of Complex Azure Environments
Geek Sync | Deployment and Management of Complex Azure EnvironmentsGeek Sync | Deployment and Management of Complex Azure Environments
Geek Sync | Deployment and Management of Complex Azure Environments
 

More from hyeongchae lee

[PGDay.Seoul 2020] PostgreSQL 13 New Features
[PGDay.Seoul 2020] PostgreSQL 13 New Features[PGDay.Seoul 2020] PostgreSQL 13 New Features
[PGDay.Seoul 2020] PostgreSQL 13 New Features
hyeongchae lee
 
[HashiTalk Korea] OCP with Super Tengen Toppa
[HashiTalk Korea] OCP with Super Tengen Toppa[HashiTalk Korea] OCP with Super Tengen Toppa
[HashiTalk Korea] OCP with Super Tengen Toppa
hyeongchae lee
 
Securing Databases with Dynamic Credentials and HashiCorp’s Vault
Securing Databases with Dynamic Credentials and HashiCorp’s VaultSecuring Databases with Dynamic Credentials and HashiCorp’s Vault
Securing Databases with Dynamic Credentials and HashiCorp’s Vault
hyeongchae lee
 
OCP with super tengen toppa
OCP with super tengen toppaOCP with super tengen toppa
OCP with super tengen toppa
hyeongchae lee
 
PostgreSQL 정기 기술 세미나 22회
PostgreSQL 정기 기술 세미나 22회PostgreSQL 정기 기술 세미나 22회
PostgreSQL 정기 기술 세미나 22회
hyeongchae lee
 
PGDay.Seoul 2016 lightingtalk
PGDay.Seoul 2016 lightingtalkPGDay.Seoul 2016 lightingtalk
PGDay.Seoul 2016 lightingtalk
hyeongchae lee
 
20141206 4 q14_dataconference_i_am_your_db
20141206 4 q14_dataconference_i_am_your_db20141206 4 q14_dataconference_i_am_your_db
20141206 4 q14_dataconference_i_am_your_db
hyeongchae lee
 
osscon_mysql_redis_plugin
osscon_mysql_redis_pluginosscon_mysql_redis_plugin
osscon_mysql_redis_plugin
hyeongchae lee
 
Oracle2DBMS Notes and Comments
Oracle2DBMS Notes and CommentsOracle2DBMS Notes and Comments
Oracle2DBMS Notes and Comments
hyeongchae lee
 
NewSQL
NewSQLNewSQL
eXtremeDB FE
eXtremeDB FEeXtremeDB FE
eXtremeDB FE
hyeongchae lee
 
in-memory database system and low latency
in-memory database system and low latencyin-memory database system and low latency
in-memory database system and low latency
hyeongchae lee
 

More from hyeongchae lee (12)

[PGDay.Seoul 2020] PostgreSQL 13 New Features
[PGDay.Seoul 2020] PostgreSQL 13 New Features[PGDay.Seoul 2020] PostgreSQL 13 New Features
[PGDay.Seoul 2020] PostgreSQL 13 New Features
 
[HashiTalk Korea] OCP with Super Tengen Toppa
[HashiTalk Korea] OCP with Super Tengen Toppa[HashiTalk Korea] OCP with Super Tengen Toppa
[HashiTalk Korea] OCP with Super Tengen Toppa
 
Securing Databases with Dynamic Credentials and HashiCorp’s Vault
Securing Databases with Dynamic Credentials and HashiCorp’s VaultSecuring Databases with Dynamic Credentials and HashiCorp’s Vault
Securing Databases with Dynamic Credentials and HashiCorp’s Vault
 
OCP with super tengen toppa
OCP with super tengen toppaOCP with super tengen toppa
OCP with super tengen toppa
 
PostgreSQL 정기 기술 세미나 22회
PostgreSQL 정기 기술 세미나 22회PostgreSQL 정기 기술 세미나 22회
PostgreSQL 정기 기술 세미나 22회
 
PGDay.Seoul 2016 lightingtalk
PGDay.Seoul 2016 lightingtalkPGDay.Seoul 2016 lightingtalk
PGDay.Seoul 2016 lightingtalk
 
20141206 4 q14_dataconference_i_am_your_db
20141206 4 q14_dataconference_i_am_your_db20141206 4 q14_dataconference_i_am_your_db
20141206 4 q14_dataconference_i_am_your_db
 
osscon_mysql_redis_plugin
osscon_mysql_redis_pluginosscon_mysql_redis_plugin
osscon_mysql_redis_plugin
 
Oracle2DBMS Notes and Comments
Oracle2DBMS Notes and CommentsOracle2DBMS Notes and Comments
Oracle2DBMS Notes and Comments
 
NewSQL
NewSQLNewSQL
NewSQL
 
eXtremeDB FE
eXtremeDB FEeXtremeDB FE
eXtremeDB FE
 
in-memory database system and low latency
in-memory database system and low latencyin-memory database system and low latency
in-memory database system and low latency
 

Recently uploaded

Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 

Recently uploaded (20)

Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 

patroni-based citrus high availability environment deployment

  • 1. Patroni-based citus high availability environment deployment ( 基于Patroni的Citus高可用环境部署 ) PGDay.Seoul & PGConf.Asia 2021 Daniel Lee 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 1
  • 2. About Me 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 2 • Dainel lee ( 李炯彩 ) • Community • MySQL Korea User Group • facebook.com/groups/mysqlko • PostgreSQL Korea • facebook.com/groups/130019777169719 • Github • github.com/dbdbdeep-git/pgday-seoul-2021-demo
  • 3. Agenda 1. Service Discovery ( *Service Mesh ) • CoreOS’s ETCD • Hashicorp’s Consul 2. Dynamic Configuration Management • ConfD • Hashicorp’s Consul-Template 3. High-Availability • Zalando’s Patroni 4. Distributed PostgreSQL as an extension • Citusdata’s Citus 5. Demo 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 3
  • 4. 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 4
  • 5. 1. Service Discovery 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 5
  • 6. What is … 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 6 Lock Service (chubby) Coordination Service (zookeeper,eureka,etcd) Service Discovery (surf,skydns,consul) Service Mesh (lstio,linkerd2)
  • 7. What can you do with Consul? 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 7 Service Discovery for connectivity Service Registry enables services to register and discover each other. Service Segmentation for security Secure service-to-service communication with automatic TLS encryption and identity-based authorization. Service Configuration for runtime configuration Feature rich Key/Value store to easily configure services.
  • 8. What can you do with Consul? 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 8 Consul-Kubernetes Deployments Use Consul service discovery and service mesh features with Kubernetes. Secure Service Communication Secure and observe communication between your services without modifying their code. Dynamic Load Balancing Automate load balancer configuration with Consul and HAProxy, Nginx, or F5.
  • 9. 3 Marine Admirals 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 9 Properties Consul Etcd Zookeeper User Interface Available X X RPC Available Available Health Check HTTP API HTTP API TCP Key Value 3 Consistency modes (sync) Good Consistency (semi) Strong Consistency Token System Available X X Language Golang Golang Java Security ACL / HTTPS HTTPS ACL Spring Cloud O O O Multi Datacenter(gossip) O X X
  • 10. 2. Dynamic Configuration 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 10
  • 11. ConfD • http://www.confd.io • Manage local application configuration files using templates and data from etcd or consul • A lightweight configuration management tool focused on: • keeping local configuration files up-to-date using data stored in etcd, consul, dynamodb, redis, vault, zookeeper, aws ssm parameter store or env vars and processing template resources. • reloading applications to pick up new config file changes 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 11
  • 12. ConfD or Consul-template Architecture 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 12 ETCD or Consul Server Confd or Consul-template Service Application (HAproxy, PostgreSQL) Configuration Template File Application Configuration File listen generate haproxy.cfg.tmpl haproxy.cfg reload check reload update
  • 13. PostgreSQL Client authentication 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 13 Consul Server Consul-template Service Postgres Server Configuration Template File Application Configuration File listen generate pg_hba.conf.tmpl pg_hba.conf reload check reload update $ consul kv put service/database/primary/auth/client “host all haproxy 10.0.1.0/24 reject”
  • 14. 3. Zalando’s Patroni 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 14
  • 15. Zalando Company 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 15
  • 16. ’s Patroni • Patroni is a template for you to create your own customized, high-availability solution using Python and - for maximum accessibility - a DCS (Distributed Configuration Store) like ZooKeeper, etcd, Consul or Kubernetes. • Currently supported PostgreSQL versions: 9.3 to 14. • Release lastest 2.1.1 ( 09.11.21 ) 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 16
  • 17. ’s Spilo • Spilo is a Docker image that provides PostgreSQL and Patroni bundled together. Patroni is a template for PostgreSQL HA. Multiple Spilos can create a resilient High Available PostgreSQL cluster. For this, you'll need to start all participating Spilos with identical etcd addresses and cluster names. • https://github.com/zalando/spilo 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 17
  • 18. 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 18
  • 19. Raft : DC to DC 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 19
  • 20. HA : Patroni vs pg_auto_failover 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 20
  • 21. 4. Citusdata’s Citus 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 21
  • 22. Hyperscale (Citus) on Azure Database for PostgreSQL 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 22
  • 23. Citusとは? by Noriyoshi Shinoda • PostgreSQL でスケールアウト環境を実現 • 複数ノードにまたがったパラレル・クエリーとパーティショニング機能 • スループット拡大を目指す • PostgreSQL の拡張(EXTENSION)として実装 • PostgreSQL 本体の変更なし • Citus Data (https://www.citusdata.com/)が開発 • 2019年1月 Microsoft による買収 • Azure Database for PostgreSQL - Hyperscale (Citus) の中核技術となっている • オープンソース版も提供(https://github.com/citusdata/citus) • 以下の機能は含まない • 自動フェイルオーバー • 自動データ・リバランス • バックアップ等の運用機能 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 23 https://www.slideshare.net/noriyoshishinoda/postgresql-conference-japan-2021-b2-citus-10
  • 24. Citus 란? • PostgreSQL로 스케일 아웃 환경 실현 • 다중 노드에 걸친 병렬 쿼리 및 파티셔닝 기능 • 처리량 확대를 목표로 • PostgreSQL 확장(EXTENSION)으로 구현 • PostgreSQL 본체 변경 없음 • Citus Data (https://www.citusdata.com/) 개발 • 2019년 1월 Microsoft에서 인수 • Azure Database for PostgreSQL - Hyperscale (Citus)의 핵심 기술입니다. • 오픈 소스 버전도 제공 (https://github.com/citusdata/citus) • 다음 기능은 포함되지 않음 • 자동 장애 조치 • 자동 데이터 재조정 • 백업 등의 운용 기능 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 24
  • 25. What is Citus ? • Achieve a scale-out environment with PostgreSQL • Parallel query and partitioning capabilities across multiple nodes • Aim to increase throughput • Implemented as an extension of PostgreSQL (EXTENSION) • No changes to PostgreSQL itself • Developed by Citus Data (https://www.citusdata.com/) • Acquired by Microsoft in January 2019 • Azure Database for PostgreSQL-is the core technology of Hyperscale (Citus) • Open source version is also available (https://github.com/citusdata/citus) • The following functions are not included • Automatic failover • Automatic data rebalancing • Operational functions such as backup 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 25
  • 26. What is Citus ? by Noriyoshi Shinoda Instance configuration • Coordinator Node • A PostgreSQL instance that accepts connections from clients • Manage metadata • Worker Node • PostgreSQL instance that actually stores the data • No communication between Worker Nodes • Install citus EXTENSION on all nodes 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 26
  • 27. What is Citus ? by Noriyoshi Shinoda Instance configuration • Processing performed by Coordinator Node • Accepting connections from clients • Final sort (ORDER BY) • Sequence processing (including SERIAL column and GENERATED AS IDENTITY column) • Handling objects other than tables and indexes • Processing executed by Worker Node • Processing SQL statements requested by Coordinator Node • Execution of ANALYZE statement • Execution of VACUUM statement • Retaining table data 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 27
  • 28. CREATE EXTENSION citus; • Add nodes: postgres=> SELECT master_add_node(‘worker-01_ip_or_dns’, 5432); Postgres=> SELECT master_add_node(’worker-02_ip_or_dns’, 5432); • Create distributed table: postgres=> CREATE TABLE events ( orders_id int, ... ); postgres=> SELECT create_distributed_table( ‘orders', ‘orders_id’ ); • Events is now distributed across shards on the nodes 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 28
  • 29. if(kakao) 2021 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 29 https://if.kakao.com/session/59
  • 30. Table structure by Noriyoshi Shinoda Distributed table • A table that distributes and stores data • Suitable for fact tables • Specify a column as the distribution key (default determines the distribution destination table by the hash value range) • The number of divisions can be specified • citus.shard_count (default value 32) • Replicas can be created on different Worker Nodes • citus.shard_replication_factor (default value 1 = no replica) 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 30
  • 31. Table structure by Noriyoshi Shinoda Distributed table • Table created in worker Node • For the table name, ShardID is added to the original table name. • If a replica is specified, a table with the same name will be created in a different Worker Node. • Same data is stored in the table with the same name • Search the citus_shards catalog to see the table names created by the Worker Node postgres=> SET citus.shard_count = 6 ; postgres=> SET citus.shard_replication_factor = 2 ; 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 31 Coordinator Worker#1 Worker#2 Worker#3 Dist1 dist1_102046 dist1_102046 dist1_102047 dist1_102047 dist1_102048 dist1_102048 dist1_102049 dist1_102049 dist1_102050 dist1_102050 dist1_102051 dist1_102051
  • 32. Demo | Skip 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 32
  • 33. if(kakao) 2021 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 33
  • 34. Q?!A 2021-11-24 PGDay.Seoul & PGConf.Asia 2021 34