SlideShare uma empresa Scribd logo
1 de 30
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 1 di 30
Patroni: PostgreSQL HA nel cloud
Lucio Grenzi
l.grenzi@gmail.com
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 2 di 30
Who I am
Delphi developer since 1999
IT Consultant 
Front end web developer
Postgresql addicted
      Nonantolando.blogspot.com
      lucio.grenzi
      lucio grenzi
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 3 di 30
AgendaAgenda
 Enterprise needs: high availability
 Cloud Databases?
 Patroni
 Data Synchonization: scalability vs performances
 Conclusion and final thoughts
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 4 di 30
Mission critical databaseMission critical database
High available
Replication
No human interaction for failover
Rapid deployment
https://www.flickr.com/photos/my_public_domain_photos/15400918696/
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 5 di 30
As a serviceAs a service
As a service
SaaS
IaaS
PaaS
BaaS
DbaaS ?
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 6 di 30
Cloud databasesCloud databases
Rapid deployment
Scalability 
Provider’s infrastructure optimization
Failover?
Flexibility?
Security?
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 7 di 30
Master is downMaster is down
Manual failover
Pg_rewind
 Require superuser access privileges
Automatic failover
One supervisor node?
Distributed supervisor nodes?
$ pg_rewind ­­target­pgdata=/var/lib/pgsql/9.6/master 
    ­­source­server="port=5432 user=postgres dbname=postgres"
$ pg_rewind ­­target­pgdata=/var/lib/pgsql/9.6/master 
    ­­source­server="port=5432 user=postgres dbname=postgres"
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 8 di 30
Patroni: an introductionPatroni: an introduction
Patoroni is a template for you to create your own
customized, high-availability solution using
Python and - for maximum accessibility - a
distributed configuration store like ZooKeeper,
etcd or Consul.
-https://github.com/zalando/patroni-
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 9 di 30
How Patroni worksHow Patroni works
Server
Client
HA Proxy
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 10 di 30
Distributed Configuration SystemDistributed Configuration System
Distributed key/value store
Like a directory tree
The state machine is kept in sync using Raft
Uses a discovery url
json/rest api
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 11 di 30
Directory treeDirectory tree
$ etcdctl ls / ­­recursive
/service
/service/pgdayitcluster
/service/pgdayitcluster/initialize
/service/pgdayitcluster/config
/service/pgdayitcluster/leader
/service/pgdayitcluster/optime
/service/pgdayitcluster/optime/leader
/service/pgdayitcluster/members
/service/pgdayitcluster/members/dbnode2
/service/pgdayitcluster/members/dbnode3
/service/pgdayitcluster/members/dbnode1
$ etcdctl ls / ­­recursive
/service
/service/pgdayitcluster
/service/pgdayitcluster/initialize
/service/pgdayitcluster/config
/service/pgdayitcluster/leader
/service/pgdayitcluster/optime
/service/pgdayitcluster/optime/leader
/service/pgdayitcluster/members
/service/pgdayitcluster/members/dbnode2
/service/pgdayitcluster/members/dbnode3
/service/pgdayitcluster/members/dbnode1
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 12 di 30
Etcd members detailEtcd members detail
 $ etcdctl get /service/testcluster/leader
dbnode2
$ etcdctl get /service/testcluster/members/dbnode2 | jq
{
  "role": "master",
  "state": "running",
  "conn_url": "postgres://172.17.0.3:5432/postgres",
  "api_url": "http://172.17.0.3:8008/patroni",
  "xlog_location": 67110528
}
$ etcdctl get /service/testcluster/members/dbnode1 | jq
{
  "role": "replica",
  "state": "running",
  "conn_url": "postgres://172.17.0.5:5432/postgres",
  "api_url": "http://172.17.0.5:8008/patroni",
  "xlog_location": 67110528
}
 $ etcdctl get /service/testcluster/leader
dbnode2
$ etcdctl get /service/testcluster/members/dbnode2 | jq
{
  "role": "master",
  "state": "running",
  "conn_url": "postgres://172.17.0.3:5432/postgres",
  "api_url": "http://172.17.0.3:8008/patroni",
  "xlog_location": 67110528
}
$ etcdctl get /service/testcluster/members/dbnode1 | jq
{
  "role": "replica",
  "state": "running",
  "conn_url": "postgres://172.17.0.5:5432/postgres",
  "api_url": "http://172.17.0.5:8008/patroni",
  "xlog_location": 67110528
}
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 13 di 30
ReplicaReplica
https://www.flickr.com/photos/roycin/4423082408/
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 14 di 30
Replication modesReplication modes
Patroni uses PostgreSQL streaming replication
By  default  Patroni  configures  PostgreSQL  for  asynchronous 
replication.
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 15 di 30
Asynchronous modeAsynchronous mode
Cluster  is  allowed  to  lose  some  committed  transactions  to 
ensure availability. 
When master server fails or becomes unavailable Patroni will 
automatically promote a sufficiently healthy standby to master.
maximum_lag_on_failover 
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 16 di 30
Synchronous replicationSynchronous replication
It  ensures  consistency  across  a  cluster  by  confirming  that 
writes  are  written  to  a  secondary  before  returning  to  the 
connecting client with a success.
It  is  not  guaranteed  zero  lost  transactions  under  all 
circumstances.
Add  to  the  parameters  section  of  your  YAML  configuration 
files:
synchronous_commit: "on"
synchronous_standby_names: "*"
synchronous_commit: "on"
synchronous_standby_names: "*"
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 17 di 30
Synchronous modeSynchronous mode
For  use  cases  where  losing  committed  transactions  is  not 
permissible
Patroni will not promote a standby unless it is certain that the 
standby  contains  all  transactions  that  may  have  returned  a 
successful commit status to client
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 18 di 30
Synchronous mode implementationSynchronous mode implementation
A node must be marked as the latest leader whenever it can 
accept write transactions.
A  node  must  be  set  as  the  synchronous  standby  in 
PostgreSQL  as  long  as  it  is  published  as  the  synchronous 
standby.
A node that is not the leader or current synchronous standby is 
not allowed to promote itself automatically.
synchronous_standby_names
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 19 di 30
HAProxyHAProxy
Patroni provides an HAProxy configuration
Used by your application in order to have a single endpoint for 
connecting to the cluster's leader
$ haproxy ­f haproxy.cfg
$ haproxy ­f haproxy.cfg
$ psql ­­host 127.0.0.1 ­­port 5000 postgres
$ psql ­­host 127.0.0.1 ­­port 5000 postgres
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 20 di 30
HAProxy.confHAProxy.conf
global
    maxconn 100
defaults
    log global
    mode tcp
    retries 2
    timeout client 30m
    timeout connect 4s
    timeout server 30m
    timeout check 5s
listen stats
    mode http
    bind *:7000
    stats enable
stats uri /
listen pgdayit
    bind *:5000
    option httpchk
    http­check expect status 200
    default­server inter 3s fall 3 rise 2 on­marked­down shutdown­sessions
    server postgresql_127.0.0.1_5432 127.0.0.1:5432 maxconn 100 check port 8008
    server postgresql_127.0.0.1_5433 127.0.0.1:5433 maxconn 100 check port 8009
global
    maxconn 100
defaults
    log global
    mode tcp
    retries 2
    timeout client 30m
    timeout connect 4s
    timeout server 30m
    timeout check 5s
listen stats
    mode http
    bind *:7000
    stats enable
stats uri /
listen pgdayit
    bind *:5000
    option httpchk
    http­check expect status 200
    default­server inter 3s fall 3 rise 2 on­marked­down shutdown­sessions
    server postgresql_127.0.0.1_5432 127.0.0.1:5432 maxconn 100 check port 8008
    server postgresql_127.0.0.1_5433 127.0.0.1:5433 maxconn 100 check port 8009
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 21 di 30
InterfacesInterfaces
API rest
patronictl
https://www.flickr.com/photos/oldstretch/1051796285/
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 22 di 30
API restAPI rest
GET /config : Get current version of dynamic configuration
PATCH  /config  :  Change  parameters  of  an  existing 
configuration
$ curl ­s localhost:8008/config
$ curl ­s localhost:8008/config
url ­s ­XPATCH ­d 
       '{"retry_timeout":5,"postgresql":{"parameters":{""max_wal_senders": “5”}}}'
rl ­s ­XPATCH ­d 
      '{"retry_timeout":5,"postgresql":{"parameters":{""max_wal_senders": “5”}}}'
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 23 di 30
API restAPI rest
PUT /config : full rewrite of an existing dynamic configuration 
unconditionally
$ curl ­s ­XPUT ­d 
        '{"maximum_lag_on_failover":1048576,
           "retry_timeout":10,
           "postgresql":
             {
             "use_slots":true,
             "use_pg_rewind":true,
             "parameters":
               {
               "hot_standby":"on",
               "wal_log_hints":"on",
               "wal_keep_segments":8,
               "wal_level":"hot_standby",
               "unix_socket_directories":".",
               "max_wal_senders":5
               }
             },
             "loop_wait":3,"ttl":20
        }' http://localhost:8008/config | jq
$ curl ­s ­XPUT ­d 
        '{"maximum_lag_on_failover":1048576,
           "retry_timeout":10,
           "postgresql":
             {
             "use_slots":true,
             "use_pg_rewind":true,
             "parameters":
               {
               "hot_standby":"on",
               "wal_log_hints":"on",
               "wal_keep_segments":8,
               "wal_level":"hot_standby",
               "unix_socket_directories":".",
               "max_wal_senders":5
               }
             },
             "loop_wait":3,"ttl":20
        }' http://localhost:8008/config | jq
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 24 di 30
API restAPI rest
POST  /reload:  change  patroni.yml  and  reload  at  runtime 
wtihout stop any service
$ curl ­s localhost:8008/reload
$ curl ­s localhost:8008/reload
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 25 di 30
PatronictlPatronictl
Usage: patronictl.py [OPTIONS] COMMAND [ARGS]...
Options:
  ­c, ­­config­file TEXT  Configuration file
  ­d, ­­dcs TEXT          Use this DCS
  ­­help                  Show this message and exit.
Commands:
  configure    Create configuration file
  dsn          Generate a dsn for the provided member,...
  edit­config  Edit cluster configuration
  failover     Failover to a replica
  flush        Flush scheduled events
  list         List the Patroni members for a given Patroni
  pause        Disable auto failover
  query        Query a Patroni PostgreSQL member
  reinit       Reinitialize cluster member
  remove       Remove cluster from DCS
  restart      Restart cluster member
  resume       Resume auto failover
  scaffold     Create a structure for the cluster in DCS
  show­config  Show cluster configuration
Usage: patronictl.py [OPTIONS] COMMAND [ARGS]...
Options:
  ­c, ­­config­file TEXT  Configuration file
  ­d, ­­dcs TEXT          Use this DCS
  ­­help                  Show this message and exit.
Commands:
  configure    Create configuration file
  dsn          Generate a dsn for the provided member,...
  edit­config  Edit cluster configuration
  failover     Failover to a replica
  flush        Flush scheduled events
  list         List the Patroni members for a given Patroni
  pause        Disable auto failover
  query        Query a Patroni PostgreSQL member
  reinit       Reinitialize cluster member
  remove       Remove cluster from DCS
  restart      Restart cluster member
  resume       Resume auto failover
  scaffold     Create a structure for the cluster in DCS
  show­config  Show cluster configuration
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 26 di 30
Patronictl failoverPatronictl failover
Manual failover
Promote a new master
atronictl.py failover <clustername>
er [dbnode2]:
idate ['dbnode1', 'dbnode3'] []:
should the failover take place (e.g. 2015­10­01T14:30)  [now]:
ou sure you want to failover cluster testcluster, demoting current master dbnode2? [
tronictl.py failover <clustername>
r [dbnode2]:
date ['dbnode1', 'dbnode3'] []:
hould the failover take place (e.g. 2015­10­01T14:30)  [now]:
u sure you want to failover cluster testcluster, demoting current master dbnode2? [y
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 27 di 30
SpiloSpilo
a  Docker  image  that  provides  PostgreSQL  and  Patroni 
bundled together
Multiple  Spilos  can  create  a  resilient  High  Available 
PostgreSQL cluster
You'll need to setup Spilo to create a database and roles for 
your application
$ psql ­h mypgdaydb ­p 5432 ­U admin ­d postgres
$ psql ­h mypgdaydb ­p 5432 ­U admin ­d postgres
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 28 di 30
RisorseRisorse
Patroni: https://github.com/zalando/patroni
Spilo:    https://github.com/zalando/spilo
Etcd:     https://github.com/coreos/etcd 
Raft:      https://raft.github.io/raft.pdf
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 29 di 30
Questions?Questions?
PGDay.IT 2017 – 13 Ottobre 2017 - Milano 30 di 30

Mais conteúdo relacionado

Mais procurados

PostgreSQLのバグとの付き合い方 ~バグの調査からコミュニティへの報告、修正パッチ投稿まで~(PostgreSQL Conference Japa...
PostgreSQLのバグとの付き合い方 ~バグの調査からコミュニティへの報告、修正パッチ投稿まで~(PostgreSQL Conference Japa...PostgreSQLのバグとの付き合い方 ~バグの調査からコミュニティへの報告、修正パッチ投稿まで~(PostgreSQL Conference Japa...
PostgreSQLのバグとの付き合い方 ~バグの調査からコミュニティへの報告、修正パッチ投稿まで~(PostgreSQL Conference Japa...NTT DATA Technology & Innovation
 
祝!PostgreSQLレプリケーション10周年!徹底紹介!!
祝!PostgreSQLレプリケーション10周年!徹底紹介!!祝!PostgreSQLレプリケーション10周年!徹底紹介!!
祝!PostgreSQLレプリケーション10周年!徹底紹介!!NTT DATA Technology & Innovation
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...ScaleGrid.io
 
YugaByte DB Internals - Storage Engine and Transactions
YugaByte DB Internals - Storage Engine and Transactions YugaByte DB Internals - Storage Engine and Transactions
YugaByte DB Internals - Storage Engine and Transactions Yugabyte
 
Security Best Practices for your Postgres Deployment
Security Best Practices for your Postgres DeploymentSecurity Best Practices for your Postgres Deployment
Security Best Practices for your Postgres DeploymentPGConf APAC
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniZalando Technology
 
High Performance Object Storage in 30 Minutes with Supermicro and MinIO
High Performance Object Storage in 30 Minutes with Supermicro and MinIOHigh Performance Object Storage in 30 Minutes with Supermicro and MinIO
High Performance Object Storage in 30 Minutes with Supermicro and MinIORebekah Rodriguez
 
Seastore: Next Generation Backing Store for Ceph
Seastore: Next Generation Backing Store for CephSeastore: Next Generation Backing Store for Ceph
Seastore: Next Generation Backing Store for CephScyllaDB
 
PostgreSQL16新機能紹介 - libpq接続ロード・バランシング(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL16新機能紹介 - libpq接続ロード・バランシング(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQL16新機能紹介 - libpq接続ロード・バランシング(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL16新機能紹介 - libpq接続ロード・バランシング(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)NTT DATA Technology & Innovation
 
使いこなそうGUC
使いこなそうGUC使いこなそうGUC
使いこなそうGUCAkio Ishida
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL AdministrationEDB
 
PostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsPostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsMydbops
 
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)NTT DATA Technology & Innovation
 
Solving PostgreSQL wicked problems
Solving PostgreSQL wicked problemsSolving PostgreSQL wicked problems
Solving PostgreSQL wicked problemsAlexander Korotkov
 
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdfDeep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdfAltinity Ltd
 
Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022Grant McAlister
 
PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)
PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)
PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)NTT DATA Technology & Innovation
 
CloudNativePGを動かしてみた! ~PostgreSQL on Kubernetes~(第34回PostgreSQLアンカンファレンス@オンライ...
CloudNativePGを動かしてみた! ~PostgreSQL on Kubernetes~(第34回PostgreSQLアンカンファレンス@オンライ...CloudNativePGを動かしてみた! ~PostgreSQL on Kubernetes~(第34回PostgreSQLアンカンファレンス@オンライ...
CloudNativePGを動かしてみた! ~PostgreSQL on Kubernetes~(第34回PostgreSQLアンカンファレンス@オンライ...NTT DATA Technology & Innovation
 
Postgres Playground で pgbench を走らせよう!(第35回PostgreSQLアンカンファレンス@オンライン 発表資料)
Postgres Playground で pgbench を走らせよう!(第35回PostgreSQLアンカンファレンス@オンライン 発表資料)Postgres Playground で pgbench を走らせよう!(第35回PostgreSQLアンカンファレンス@オンライン 発表資料)
Postgres Playground で pgbench を走らせよう!(第35回PostgreSQLアンカンファレンス@オンライン 発表資料)NTT DATA Technology & Innovation
 
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DB
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DBDistributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DB
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DBYugabyteDB
 

Mais procurados (20)

PostgreSQLのバグとの付き合い方 ~バグの調査からコミュニティへの報告、修正パッチ投稿まで~(PostgreSQL Conference Japa...
PostgreSQLのバグとの付き合い方 ~バグの調査からコミュニティへの報告、修正パッチ投稿まで~(PostgreSQL Conference Japa...PostgreSQLのバグとの付き合い方 ~バグの調査からコミュニティへの報告、修正パッチ投稿まで~(PostgreSQL Conference Japa...
PostgreSQLのバグとの付き合い方 ~バグの調査からコミュニティへの報告、修正パッチ投稿まで~(PostgreSQL Conference Japa...
 
祝!PostgreSQLレプリケーション10周年!徹底紹介!!
祝!PostgreSQLレプリケーション10周年!徹底紹介!!祝!PostgreSQLレプリケーション10周年!徹底紹介!!
祝!PostgreSQLレプリケーション10周年!徹底紹介!!
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
 
YugaByte DB Internals - Storage Engine and Transactions
YugaByte DB Internals - Storage Engine and Transactions YugaByte DB Internals - Storage Engine and Transactions
YugaByte DB Internals - Storage Engine and Transactions
 
Security Best Practices for your Postgres Deployment
Security Best Practices for your Postgres DeploymentSecurity Best Practices for your Postgres Deployment
Security Best Practices for your Postgres Deployment
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando Patroni
 
High Performance Object Storage in 30 Minutes with Supermicro and MinIO
High Performance Object Storage in 30 Minutes with Supermicro and MinIOHigh Performance Object Storage in 30 Minutes with Supermicro and MinIO
High Performance Object Storage in 30 Minutes with Supermicro and MinIO
 
Seastore: Next Generation Backing Store for Ceph
Seastore: Next Generation Backing Store for CephSeastore: Next Generation Backing Store for Ceph
Seastore: Next Generation Backing Store for Ceph
 
PostgreSQL16新機能紹介 - libpq接続ロード・バランシング(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL16新機能紹介 - libpq接続ロード・バランシング(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQL16新機能紹介 - libpq接続ロード・バランシング(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL16新機能紹介 - libpq接続ロード・バランシング(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
使いこなそうGUC
使いこなそうGUC使いこなそうGUC
使いこなそうGUC
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
 
PostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsPostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability Methods
 
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
Solving PostgreSQL wicked problems
Solving PostgreSQL wicked problemsSolving PostgreSQL wicked problems
Solving PostgreSQL wicked problems
 
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdfDeep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
 
Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022
 
PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)
PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)
PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)
 
CloudNativePGを動かしてみた! ~PostgreSQL on Kubernetes~(第34回PostgreSQLアンカンファレンス@オンライ...
CloudNativePGを動かしてみた! ~PostgreSQL on Kubernetes~(第34回PostgreSQLアンカンファレンス@オンライ...CloudNativePGを動かしてみた! ~PostgreSQL on Kubernetes~(第34回PostgreSQLアンカンファレンス@オンライ...
CloudNativePGを動かしてみた! ~PostgreSQL on Kubernetes~(第34回PostgreSQLアンカンファレンス@オンライ...
 
Postgres Playground で pgbench を走らせよう!(第35回PostgreSQLアンカンファレンス@オンライン 発表資料)
Postgres Playground で pgbench を走らせよう!(第35回PostgreSQLアンカンファレンス@オンライン 発表資料)Postgres Playground で pgbench を走らせよう!(第35回PostgreSQLアンカンファレンス@オンライン 発表資料)
Postgres Playground で pgbench を走らせよう!(第35回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DB
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DBDistributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DB
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DB
 

Semelhante a Patroni: PostgreSQL HA in the cloud

High availability Microsoft vs Oracle
High availability Microsoft vs OracleHigh availability Microsoft vs Oracle
High availability Microsoft vs OracleJacques Kostic
 
Postgrest: the REST API for PostgreSQL databases
Postgrest: the REST API for PostgreSQL databasesPostgrest: the REST API for PostgreSQL databases
Postgrest: the REST API for PostgreSQL databasesLucio Grenzi
 
Alessandro Confetti - Learn how to build decentralized and serverless html5 a...
Alessandro Confetti - Learn how to build decentralized and serverless html5 a...Alessandro Confetti - Learn how to build decentralized and serverless html5 a...
Alessandro Confetti - Learn how to build decentralized and serverless html5 a...Codemotion
 
How to integrate PWA solutions successfully (hosting)
How to integrate PWA solutions successfully (hosting)How to integrate PWA solutions successfully (hosting)
How to integrate PWA solutions successfully (hosting)Jonas Hünig
 
Trivadis TechEvent 2017 Reach effective High Availability solution by Jacques...
Trivadis TechEvent 2017 Reach effective High Availability solution by Jacques...Trivadis TechEvent 2017 Reach effective High Availability solution by Jacques...
Trivadis TechEvent 2017 Reach effective High Availability solution by Jacques...Trivadis
 
How to use Postgresql in order to handle Prometheus metrics storage
How to use Postgresql in order to handle Prometheus metrics storageHow to use Postgresql in order to handle Prometheus metrics storage
How to use Postgresql in order to handle Prometheus metrics storageLucio Grenzi
 
MongoDB as a Universal Data Store for Process Data
MongoDB as a Universal Data Store for Process DataMongoDB as a Universal Data Store for Process Data
MongoDB as a Universal Data Store for Process DataMongoDB
 
BUILD with Microsoft - Radu Stefan
 BUILD with Microsoft - Radu Stefan BUILD with Microsoft - Radu Stefan
BUILD with Microsoft - Radu StefanITCamp
 
ibm-zconnect-mule.pdf
ibm-zconnect-mule.pdfibm-zconnect-mule.pdf
ibm-zconnect-mule.pdfLaLa788688
 
Sopra Steria / Interconnect2017 Digital Architecture
Sopra Steria / Interconnect2017 Digital ArchitectureSopra Steria / Interconnect2017 Digital Architecture
Sopra Steria / Interconnect2017 Digital ArchitectureXavier BERNARD
 
SAP Training Manual Project Systems .pdf
SAP Training Manual Project Systems .pdfSAP Training Manual Project Systems .pdf
SAP Training Manual Project Systems .pdfDineshChanakya1
 
Rabbitmq & Postgresql
Rabbitmq & PostgresqlRabbitmq & Postgresql
Rabbitmq & PostgresqlLucio Grenzi
 
Setup von Configuration Management mit Ansible für smarte DevOps
Setup von Configuration Management mit Ansible für smarte DevOpsSetup von Configuration Management mit Ansible für smarte DevOps
Setup von Configuration Management mit Ansible für smarte DevOpsATIX AG
 
Eliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyEliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyTechWell
 
Migrate to-pg pgconfeu2019
Migrate to-pg pgconfeu2019Migrate to-pg pgconfeu2019
Migrate to-pg pgconfeu2019Loxodata
 
Technology trends in a maturing IoT
Technology trends in a maturing IoTTechnology trends in a maturing IoT
Technology trends in a maturing IoTMichiel Fokke
 
Integration made easy with Azure Service Bus and APIM
Integration made easy with Azure Service Bus and APIMIntegration made easy with Azure Service Bus and APIM
Integration made easy with Azure Service Bus and APIMBizTalk360
 
Salottino MIX 2017 - ARouteServer - IXP Automation Made Easy
Salottino MIX 2017 - ARouteServer - IXP Automation Made EasySalottino MIX 2017 - ARouteServer - IXP Automation Made Easy
Salottino MIX 2017 - ARouteServer - IXP Automation Made EasyPier Carlo Chiodi
 
High availability microsoftvsoracle
High availability microsoftvsoracleHigh availability microsoftvsoracle
High availability microsoftvsoracleJacques Kostic
 
Domain Specific Languages and C++ Code Generation
Domain Specific Languages and C++ Code GenerationDomain Specific Languages and C++ Code Generation
Domain Specific Languages and C++ Code GenerationOvidiu Farauanu
 

Semelhante a Patroni: PostgreSQL HA in the cloud (20)

High availability Microsoft vs Oracle
High availability Microsoft vs OracleHigh availability Microsoft vs Oracle
High availability Microsoft vs Oracle
 
Postgrest: the REST API for PostgreSQL databases
Postgrest: the REST API for PostgreSQL databasesPostgrest: the REST API for PostgreSQL databases
Postgrest: the REST API for PostgreSQL databases
 
Alessandro Confetti - Learn how to build decentralized and serverless html5 a...
Alessandro Confetti - Learn how to build decentralized and serverless html5 a...Alessandro Confetti - Learn how to build decentralized and serverless html5 a...
Alessandro Confetti - Learn how to build decentralized and serverless html5 a...
 
How to integrate PWA solutions successfully (hosting)
How to integrate PWA solutions successfully (hosting)How to integrate PWA solutions successfully (hosting)
How to integrate PWA solutions successfully (hosting)
 
Trivadis TechEvent 2017 Reach effective High Availability solution by Jacques...
Trivadis TechEvent 2017 Reach effective High Availability solution by Jacques...Trivadis TechEvent 2017 Reach effective High Availability solution by Jacques...
Trivadis TechEvent 2017 Reach effective High Availability solution by Jacques...
 
How to use Postgresql in order to handle Prometheus metrics storage
How to use Postgresql in order to handle Prometheus metrics storageHow to use Postgresql in order to handle Prometheus metrics storage
How to use Postgresql in order to handle Prometheus metrics storage
 
MongoDB as a Universal Data Store for Process Data
MongoDB as a Universal Data Store for Process DataMongoDB as a Universal Data Store for Process Data
MongoDB as a Universal Data Store for Process Data
 
BUILD with Microsoft - Radu Stefan
 BUILD with Microsoft - Radu Stefan BUILD with Microsoft - Radu Stefan
BUILD with Microsoft - Radu Stefan
 
ibm-zconnect-mule.pdf
ibm-zconnect-mule.pdfibm-zconnect-mule.pdf
ibm-zconnect-mule.pdf
 
Sopra Steria / Interconnect2017 Digital Architecture
Sopra Steria / Interconnect2017 Digital ArchitectureSopra Steria / Interconnect2017 Digital Architecture
Sopra Steria / Interconnect2017 Digital Architecture
 
SAP Training Manual Project Systems .pdf
SAP Training Manual Project Systems .pdfSAP Training Manual Project Systems .pdf
SAP Training Manual Project Systems .pdf
 
Rabbitmq & Postgresql
Rabbitmq & PostgresqlRabbitmq & Postgresql
Rabbitmq & Postgresql
 
Setup von Configuration Management mit Ansible für smarte DevOps
Setup von Configuration Management mit Ansible für smarte DevOpsSetup von Configuration Management mit Ansible für smarte DevOps
Setup von Configuration Management mit Ansible für smarte DevOps
 
Eliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyEliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps Strategy
 
Migrate to-pg pgconfeu2019
Migrate to-pg pgconfeu2019Migrate to-pg pgconfeu2019
Migrate to-pg pgconfeu2019
 
Technology trends in a maturing IoT
Technology trends in a maturing IoTTechnology trends in a maturing IoT
Technology trends in a maturing IoT
 
Integration made easy with Azure Service Bus and APIM
Integration made easy with Azure Service Bus and APIMIntegration made easy with Azure Service Bus and APIM
Integration made easy with Azure Service Bus and APIM
 
Salottino MIX 2017 - ARouteServer - IXP Automation Made Easy
Salottino MIX 2017 - ARouteServer - IXP Automation Made EasySalottino MIX 2017 - ARouteServer - IXP Automation Made Easy
Salottino MIX 2017 - ARouteServer - IXP Automation Made Easy
 
High availability microsoftvsoracle
High availability microsoftvsoracleHigh availability microsoftvsoracle
High availability microsoftvsoracle
 
Domain Specific Languages and C++ Code Generation
Domain Specific Languages and C++ Code GenerationDomain Specific Languages and C++ Code Generation
Domain Specific Languages and C++ Code Generation
 

Mais de Lucio Grenzi

Building serverless application on the Apache Openwhisk platform
Building serverless application on the Apache Openwhisk platformBuilding serverless application on the Apache Openwhisk platform
Building serverless application on the Apache Openwhisk platformLucio Grenzi
 
Use Ionic Framework to develop mobile application
Use Ionic Framework to develop mobile applicationUse Ionic Framework to develop mobile application
Use Ionic Framework to develop mobile applicationLucio Grenzi
 
Jenkins djangovillage
Jenkins djangovillageJenkins djangovillage
Jenkins djangovillageLucio Grenzi
 
Geodjango and HTML 5
Geodjango and HTML 5Geodjango and HTML 5
Geodjango and HTML 5Lucio Grenzi
 
PLV8 - The PostgreSQL web side
PLV8 - The PostgreSQL web sidePLV8 - The PostgreSQL web side
PLV8 - The PostgreSQL web sideLucio Grenzi
 
node.js e Postgresql
node.js e Postgresqlnode.js e Postgresql
node.js e PostgresqlLucio Grenzi
 

Mais de Lucio Grenzi (10)

Building serverless application on the Apache Openwhisk platform
Building serverless application on the Apache Openwhisk platformBuilding serverless application on the Apache Openwhisk platform
Building serverless application on the Apache Openwhisk platform
 
Full slidescr16
Full slidescr16Full slidescr16
Full slidescr16
 
Use Ionic Framework to develop mobile application
Use Ionic Framework to develop mobile applicationUse Ionic Framework to develop mobile application
Use Ionic Framework to develop mobile application
 
Jenkins djangovillage
Jenkins djangovillageJenkins djangovillage
Jenkins djangovillage
 
Geodjango and HTML 5
Geodjango and HTML 5Geodjango and HTML 5
Geodjango and HTML 5
 
PLV8 - The PostgreSQL web side
PLV8 - The PostgreSQL web sidePLV8 - The PostgreSQL web side
PLV8 - The PostgreSQL web side
 
Pg tap
Pg tapPg tap
Pg tap
 
Geodjango
GeodjangoGeodjango
Geodjango
 
Yui app-framework
Yui app-frameworkYui app-framework
Yui app-framework
 
node.js e Postgresql
node.js e Postgresqlnode.js e Postgresql
node.js e Postgresql
 

Último

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durbanmasabamasaba
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...masabamasaba
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 

Último (20)

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 

Patroni: PostgreSQL HA in the cloud

  • 1. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 1 di 30 Patroni: PostgreSQL HA nel cloud Lucio Grenzi l.grenzi@gmail.com
  • 2. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 2 di 30 Who I am Delphi developer since 1999 IT Consultant  Front end web developer Postgresql addicted       Nonantolando.blogspot.com       lucio.grenzi       lucio grenzi
  • 3. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 3 di 30 AgendaAgenda  Enterprise needs: high availability  Cloud Databases?  Patroni  Data Synchonization: scalability vs performances  Conclusion and final thoughts
  • 4. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 4 di 30 Mission critical databaseMission critical database High available Replication No human interaction for failover Rapid deployment https://www.flickr.com/photos/my_public_domain_photos/15400918696/
  • 5. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 5 di 30 As a serviceAs a service As a service SaaS IaaS PaaS BaaS DbaaS ?
  • 6. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 6 di 30 Cloud databasesCloud databases Rapid deployment Scalability  Provider’s infrastructure optimization Failover? Flexibility? Security?
  • 7. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 7 di 30 Master is downMaster is down Manual failover Pg_rewind  Require superuser access privileges Automatic failover One supervisor node? Distributed supervisor nodes? $ pg_rewind ­­target­pgdata=/var/lib/pgsql/9.6/master      ­­source­server="port=5432 user=postgres dbname=postgres" $ pg_rewind ­­target­pgdata=/var/lib/pgsql/9.6/master      ­­source­server="port=5432 user=postgres dbname=postgres"
  • 8. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 8 di 30 Patroni: an introductionPatroni: an introduction Patoroni is a template for you to create your own customized, high-availability solution using Python and - for maximum accessibility - a distributed configuration store like ZooKeeper, etcd or Consul. -https://github.com/zalando/patroni-
  • 9. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 9 di 30 How Patroni worksHow Patroni works Server Client HA Proxy
  • 10. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 10 di 30 Distributed Configuration SystemDistributed Configuration System Distributed key/value store Like a directory tree The state machine is kept in sync using Raft Uses a discovery url json/rest api
  • 11. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 11 di 30 Directory treeDirectory tree $ etcdctl ls / ­­recursive /service /service/pgdayitcluster /service/pgdayitcluster/initialize /service/pgdayitcluster/config /service/pgdayitcluster/leader /service/pgdayitcluster/optime /service/pgdayitcluster/optime/leader /service/pgdayitcluster/members /service/pgdayitcluster/members/dbnode2 /service/pgdayitcluster/members/dbnode3 /service/pgdayitcluster/members/dbnode1 $ etcdctl ls / ­­recursive /service /service/pgdayitcluster /service/pgdayitcluster/initialize /service/pgdayitcluster/config /service/pgdayitcluster/leader /service/pgdayitcluster/optime /service/pgdayitcluster/optime/leader /service/pgdayitcluster/members /service/pgdayitcluster/members/dbnode2 /service/pgdayitcluster/members/dbnode3 /service/pgdayitcluster/members/dbnode1
  • 12. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 12 di 30 Etcd members detailEtcd members detail  $ etcdctl get /service/testcluster/leader dbnode2 $ etcdctl get /service/testcluster/members/dbnode2 | jq {   "role": "master",   "state": "running",   "conn_url": "postgres://172.17.0.3:5432/postgres",   "api_url": "http://172.17.0.3:8008/patroni",   "xlog_location": 67110528 } $ etcdctl get /service/testcluster/members/dbnode1 | jq {   "role": "replica",   "state": "running",   "conn_url": "postgres://172.17.0.5:5432/postgres",   "api_url": "http://172.17.0.5:8008/patroni",   "xlog_location": 67110528 }  $ etcdctl get /service/testcluster/leader dbnode2 $ etcdctl get /service/testcluster/members/dbnode2 | jq {   "role": "master",   "state": "running",   "conn_url": "postgres://172.17.0.3:5432/postgres",   "api_url": "http://172.17.0.3:8008/patroni",   "xlog_location": 67110528 } $ etcdctl get /service/testcluster/members/dbnode1 | jq {   "role": "replica",   "state": "running",   "conn_url": "postgres://172.17.0.5:5432/postgres",   "api_url": "http://172.17.0.5:8008/patroni",   "xlog_location": 67110528 }
  • 13. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 13 di 30 ReplicaReplica https://www.flickr.com/photos/roycin/4423082408/
  • 14. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 14 di 30 Replication modesReplication modes Patroni uses PostgreSQL streaming replication By  default  Patroni  configures  PostgreSQL  for  asynchronous  replication.
  • 15. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 15 di 30 Asynchronous modeAsynchronous mode Cluster  is  allowed  to  lose  some  committed  transactions  to  ensure availability.  When master server fails or becomes unavailable Patroni will  automatically promote a sufficiently healthy standby to master. maximum_lag_on_failover 
  • 16. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 16 di 30 Synchronous replicationSynchronous replication It  ensures  consistency  across  a  cluster  by  confirming  that  writes  are  written  to  a  secondary  before  returning  to  the  connecting client with a success. It  is  not  guaranteed  zero  lost  transactions  under  all  circumstances. Add  to  the  parameters  section  of  your  YAML  configuration  files: synchronous_commit: "on" synchronous_standby_names: "*" synchronous_commit: "on" synchronous_standby_names: "*"
  • 17. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 17 di 30 Synchronous modeSynchronous mode For  use  cases  where  losing  committed  transactions  is  not  permissible Patroni will not promote a standby unless it is certain that the  standby  contains  all  transactions  that  may  have  returned  a  successful commit status to client
  • 18. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 18 di 30 Synchronous mode implementationSynchronous mode implementation A node must be marked as the latest leader whenever it can  accept write transactions. A  node  must  be  set  as  the  synchronous  standby  in  PostgreSQL  as  long  as  it  is  published  as  the  synchronous  standby. A node that is not the leader or current synchronous standby is  not allowed to promote itself automatically. synchronous_standby_names
  • 19. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 19 di 30 HAProxyHAProxy Patroni provides an HAProxy configuration Used by your application in order to have a single endpoint for  connecting to the cluster's leader $ haproxy ­f haproxy.cfg $ haproxy ­f haproxy.cfg $ psql ­­host 127.0.0.1 ­­port 5000 postgres $ psql ­­host 127.0.0.1 ­­port 5000 postgres
  • 20. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 20 di 30 HAProxy.confHAProxy.conf global     maxconn 100 defaults     log global     mode tcp     retries 2     timeout client 30m     timeout connect 4s     timeout server 30m     timeout check 5s listen stats     mode http     bind *:7000     stats enable stats uri / listen pgdayit     bind *:5000     option httpchk     http­check expect status 200     default­server inter 3s fall 3 rise 2 on­marked­down shutdown­sessions     server postgresql_127.0.0.1_5432 127.0.0.1:5432 maxconn 100 check port 8008     server postgresql_127.0.0.1_5433 127.0.0.1:5433 maxconn 100 check port 8009 global     maxconn 100 defaults     log global     mode tcp     retries 2     timeout client 30m     timeout connect 4s     timeout server 30m     timeout check 5s listen stats     mode http     bind *:7000     stats enable stats uri / listen pgdayit     bind *:5000     option httpchk     http­check expect status 200     default­server inter 3s fall 3 rise 2 on­marked­down shutdown­sessions     server postgresql_127.0.0.1_5432 127.0.0.1:5432 maxconn 100 check port 8008     server postgresql_127.0.0.1_5433 127.0.0.1:5433 maxconn 100 check port 8009
  • 21. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 21 di 30 InterfacesInterfaces API rest patronictl https://www.flickr.com/photos/oldstretch/1051796285/
  • 22. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 22 di 30 API restAPI rest GET /config : Get current version of dynamic configuration PATCH  /config  :  Change  parameters  of  an  existing  configuration $ curl ­s localhost:8008/config $ curl ­s localhost:8008/config url ­s ­XPATCH ­d         '{"retry_timeout":5,"postgresql":{"parameters":{""max_wal_senders": “5”}}}' rl ­s ­XPATCH ­d        '{"retry_timeout":5,"postgresql":{"parameters":{""max_wal_senders": “5”}}}'
  • 23. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 23 di 30 API restAPI rest PUT /config : full rewrite of an existing dynamic configuration  unconditionally $ curl ­s ­XPUT ­d          '{"maximum_lag_on_failover":1048576,            "retry_timeout":10,            "postgresql":              {              "use_slots":true,              "use_pg_rewind":true,              "parameters":                {                "hot_standby":"on",                "wal_log_hints":"on",                "wal_keep_segments":8,                "wal_level":"hot_standby",                "unix_socket_directories":".",                "max_wal_senders":5                }              },              "loop_wait":3,"ttl":20         }' http://localhost:8008/config | jq $ curl ­s ­XPUT ­d          '{"maximum_lag_on_failover":1048576,            "retry_timeout":10,            "postgresql":              {              "use_slots":true,              "use_pg_rewind":true,              "parameters":                {                "hot_standby":"on",                "wal_log_hints":"on",                "wal_keep_segments":8,                "wal_level":"hot_standby",                "unix_socket_directories":".",                "max_wal_senders":5                }              },              "loop_wait":3,"ttl":20         }' http://localhost:8008/config | jq
  • 24. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 24 di 30 API restAPI rest POST  /reload:  change  patroni.yml  and  reload  at  runtime  wtihout stop any service $ curl ­s localhost:8008/reload $ curl ­s localhost:8008/reload
  • 25. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 25 di 30 PatronictlPatronictl Usage: patronictl.py [OPTIONS] COMMAND [ARGS]... Options:   ­c, ­­config­file TEXT  Configuration file   ­d, ­­dcs TEXT          Use this DCS   ­­help                  Show this message and exit. Commands:   configure    Create configuration file   dsn          Generate a dsn for the provided member,...   edit­config  Edit cluster configuration   failover     Failover to a replica   flush        Flush scheduled events   list         List the Patroni members for a given Patroni   pause        Disable auto failover   query        Query a Patroni PostgreSQL member   reinit       Reinitialize cluster member   remove       Remove cluster from DCS   restart      Restart cluster member   resume       Resume auto failover   scaffold     Create a structure for the cluster in DCS   show­config  Show cluster configuration Usage: patronictl.py [OPTIONS] COMMAND [ARGS]... Options:   ­c, ­­config­file TEXT  Configuration file   ­d, ­­dcs TEXT          Use this DCS   ­­help                  Show this message and exit. Commands:   configure    Create configuration file   dsn          Generate a dsn for the provided member,...   edit­config  Edit cluster configuration   failover     Failover to a replica   flush        Flush scheduled events   list         List the Patroni members for a given Patroni   pause        Disable auto failover   query        Query a Patroni PostgreSQL member   reinit       Reinitialize cluster member   remove       Remove cluster from DCS   restart      Restart cluster member   resume       Resume auto failover   scaffold     Create a structure for the cluster in DCS   show­config  Show cluster configuration
  • 26. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 26 di 30 Patronictl failoverPatronictl failover Manual failover Promote a new master atronictl.py failover <clustername> er [dbnode2]: idate ['dbnode1', 'dbnode3'] []: should the failover take place (e.g. 2015­10­01T14:30)  [now]: ou sure you want to failover cluster testcluster, demoting current master dbnode2? [ tronictl.py failover <clustername> r [dbnode2]: date ['dbnode1', 'dbnode3'] []: hould the failover take place (e.g. 2015­10­01T14:30)  [now]: u sure you want to failover cluster testcluster, demoting current master dbnode2? [y
  • 27. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 27 di 30 SpiloSpilo a  Docker  image  that  provides  PostgreSQL  and  Patroni  bundled together Multiple  Spilos  can  create  a  resilient  High  Available  PostgreSQL cluster You'll need to setup Spilo to create a database and roles for  your application $ psql ­h mypgdaydb ­p 5432 ­U admin ­d postgres $ psql ­h mypgdaydb ­p 5432 ­U admin ­d postgres
  • 28. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 28 di 30 RisorseRisorse Patroni: https://github.com/zalando/patroni Spilo:    https://github.com/zalando/spilo Etcd:     https://github.com/coreos/etcd  Raft:      https://raft.github.io/raft.pdf
  • 29. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 29 di 30 Questions?Questions?
  • 30. PGDay.IT 2017 – 13 Ottobre 2017 - Milano 30 di 30