Automated Upgrades of PostgreSQL Clusters in Cloud

Similar documents
MSc, Computer & Systems TalTech. Writes on 2ndQuadrant blog From Turkey Lives in

Untangling the PostgreSQL upgrade

Postgres in Amazon RDS. Denish Patel Lead Database Architect

HOW TO PLAN & EXECUTE A SUCCESSFUL CLOUD MIGRATION

MySQL In the Cloud. Migration, Best Practices, High Availability, Scaling. Peter Zaitsev CEO Los Angeles MySQL Meetup June 12 th, 2017.

Agenda. AWS Database Services Traditional vs AWS Data services model Amazon RDS Redshift DynamoDB ElastiCache

How to Move Your Oracle Database to The Cloud. Clay Jackson Database Solutions Sales Engineer

Highway to Hell or Stairway to Cloud?

High Availability Infrastructure for Cloud Computing

What is wrong with PostgreSQL? OR What does Oracle have that PostgreSQL should? Richard Stephan

AWS Database Migration Service

P a g e 1. Teknologisk Institut. Online kursus k SysAdmin & DevOps Collection

How CloudEndure Works

MySQL and Virtualization Guide

Actifio Test Data Management

SUSE at the Point of Service. Joachim Werner Senior Product Manager

Introduction to Database Services

IBM Compose Managed Platform for Multiple Open Source Databases

Oracle made it easy: Cloud DB Vergleich

Application Guide. Connection Broker. Advanced Connection and Capacity Management For Hybrid Clouds

How to Keep UP Through Digital Transformation with Next-Generation App Development

PGConf US PostgreSQL Power on Power. Michael Meskes. Bernd Helmle. Julian Schauder. credativ

How CloudEndure Works

There And Back Again

Aurora, RDS, or On-Prem, Which is right for you

Oracle Multitenant What s new in Oracle Database 12c Release ?

Retrospective: The Magento Commerce Cloud at Work

Asset Bank - Shared Hosting. Service Description

Modernize Your Backup and DR Using Actifio in AWS

Beyond 1001 Dedicated Data Service Instances

Running MySQL on AWS. Michael Coburn Wednesday, April 15th, 2015

How CloudEndure Disaster Recovery Works

Zero Downtime Migrations

PostgreSQL migration from AWS RDS to EC2

POSTGRESQL ON AWS: TIPS & TRICKS (AND HORROR STORIES) ALEXANDER KUKUSHKIN. PostgresConf US

ArcGIS Server Architecture Considerations. Andrew Sakowicz

POSTGRESQL ON AWS: TIPS & TRICKS (AND HORROR STORIES) ALEXANDER KUKUSHKIN

CIT 668: System Architecture. Amazon Web Services

HowTo DR. Josh Berkus PostgreSQL Experts SCALE 2014

RACKSPACE ONMETAL I/O V2 OUTPERFORMS AMAZON EC2 BY UP TO 2X IN BENCHMARK TESTING

HPC in Cloud. Presenter: Naresh K. Sehgal Contributors: Billy Cox, John M. Acken, Sohum Sohoni

Harmony Quick Upgrade Guide

Which technology to choose in AWS?

How CloudEndure Disaster Recovery Works

What is the Future of PostgreSQL?

POSTGRESQL ON AWS: TIPS & TRICKS (AND HORROR STORIES) ALEXANDER KUKUSHKIN. PGConf.EU 2017, Warsaw

Large Scale MySQL Migration

Real-Time & Big Data GIS: Best Practices. Josh Joyner Adam Mollenkopf

The Right Choice for DR: Data Guard, Stretch Clusters, or Remote Mirroring. Ashish Ray Group Product Manager Oracle Corporation

Virtualizing Oracle on VMware

PostgreSQL upgrade yesterday, today, tomorrow. Zdeněk Kotala Solaris Revenue Product Engineer Sun Microsystems

JELASTIC PLATFORM-AS-INFRASTRUCTURE

Consolidate and Prepare for Cloud Efficiencies Oracle Database 12c Oracle Multitenant Option

How we built a highly scalable Machine Learning platform using Apache Mesos

Kubernetes for Stateful Workloads Benchmarks

VEMBU VS VEEAM Why Vembu is Better. VEMBU TECHNOLOGIES

QUICK START: VERITAS STORAGE FOUNDATION BASIC FOR AMAZON EC2

Running Databases in Containers.

Oracle Autonomous Database

Virtualization with Arcserve Unified Data Protection

ArcGIS 10.3 Server on Amazon Web Services

Using AWS Data Migration Service with RDS

Veritas CloudPoint 1.0 Administrator's Guide

Deploying High Availability and Business Resilient R12 Applications over the Cloud

Hyper-Convergence De-mystified. Francis O Haire Group Technology Director

Accessing other data fdw, dblink, pglogical, plproxy,...

AWS Solution Architecture Patterns

Highly Available Database Architectures in AWS. Santa Clara, California April 23th 25th, 2018 Mike Benshoof, Technical Account Manager, Percona

CACHE ME IF YOU CAN! GETTING STARTED WITH AMAZON ELASTICACHE. AWS Charlotte Meetup / Charlotte Cloud Computing Meetup Bilal Soylu October 2013

What is Cloud Computing? Cloud computing is the dynamic delivery of IT resources and capabilities as a Service over the Internet.

Enterprise Open Source Databases

Enterprise Manager: Scalable Oracle Management

Faculté Polytechnique

Migrating Oracle Databases from Amazon Web Services to Oracle Cloud Infrastructure Database O R A C L E W H I T E P A P E R M A Y

Introduction to Oracle Databases in the Cloud

Design Patterns for the Cloud. MCSN - N. Tonellotto - Distributed Enabling Platforms 68

Oracle DBA workshop I

NINE MYTHS ABOUT. DDo S PROTECTION

SRM University, Kattankulathur Department of Information Technology IT1019 Information Storage and Management Model Examination

Technical Overview. Jack Smith Sr. Solutions Architect

Deploy. A step-by-step guide to successfully deploying your new app with the FileMaker Platform

Secure Block Storage (SBS) FAQ

A10 HARMONY CONTROLLER

Become an Always-On Business. Doug Hazelman VP, Product Strategy Veeam Software

COMPTIA CLO-001 EXAM QUESTIONS & ANSWERS

Copyright 2012 EMC Corporation. All rights reserved.

McAfee Virtual Network Security Platform 8.4 Revision A

Designing Fault-Tolerant Applications

Hystax. Live Migration and Disaster Recovery. Hystax B.V. Copyright

Using and Developing with Azure. Joshua Drew

Migrating Enterprise Applications to the Cloud Session 672. Leighton L. Nelson

RA-GRS, 130 replication support, ZRS, 130

Robust QAD Infrastructure Leveraging VMware and Netapp. Sekhar Athmakuri IT Manager

DISTRIBUTED SYSTEMS [COMP9243] Lecture 8a: Cloud Computing WHAT IS CLOUD COMPUTING? 2. Slide 3. Slide 1. Why is it called Cloud?

Information Security Policy

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

OPTIMIZING YOUR ORACLE DATABASE ENVIRONMENTS

Availability for the Always-On Enterprise

` 2017 CloudEndure 1

PGConf.Russia 2019, Moscow. Alexander Kukushkin

Transcription:

Gülçin Yıldırım Automated Upgrades of PostgreSQL Clusters in Cloud 1

select * from me; Site Reliability Engineer @ 2ndQuadrant Board Member @ PostgreSQL Europe MSc Comp. & Systems Eng. @ Tallinn University of Technology Writes on 2ndQuadrant blog Does some childish paintings Loves independent films From Turkey @ apatheticmagpie Skype: gulcin2ndq Github: gulcin 2

Agenda Database Upgrades Why Logical Replication? Platform Implementation Case Studies & Results Applicability & Limitations Conclusion 3

Problems? DOWNTIME SLAs? Low Capacity? Revenue Loss Reputation Loss High Availability? 4

Database Anyone? Banks Social Networks Desktop Apps Startups Medium-size Enterprises 5

Upgrade,or not to Upgrade New features Security patches Perfomance Updates Bug fixes Outdated, no support Vulnerable to attacks Poor Perfomance Buggy, hard to maintain 6

Why Automate? Risk & Errors Cost Time-to-market Reproducibility Repeatability Efficiency Updating nasa.gov: 1 hr to 5 mins Patching updates: Multi-day to 45 mins Application stack setup: 1-2 hrs to 10 mins 7

Ansible Loves PostgreSQL ( in the s ) AWS Modules: 100 Postgres Modules: 6 50 Upgrade 116 Cloud 252 PostgreSQL 208 Database 8

Database Upgrades 1 same or compatible 2 storage format hard to guarantee performance optimization - data structures logical copy (dump) load into new server traditional approach offline (downtime) 3 convert data from 4 old format to new can be online (perf?) offline (downtime) often shorter (2nd) logical dump (restore) capture changes while upgrade replicate after restore min downtime 9

Logical Replication Rocks! Offline Conversion pg_dump/pg_restore pg_upgrade 1 Online Conversion pglogical pglupgrade 2 10

Elements of the solution pglogical pgbouncer Ansible AWS pglupgrade 11

Pglupgrade playbook 8 plays config.yml host.ini [old-primary] 54.171.211.188 [new-primary] 54.246.183.100 [old-standbys] 54.77.249.81 54.154.49.180 [new-standbys:children] old-standbys [pgbouncer] 54.154.49.180 orchestrates the upgrade operation Inventory file host.ini $ ansible-playbook -i hosts.ini pglupgrade.yml Running pglupgrade playbook 12

Pglupgrade playbook ansible_user: admin pglupgrade_user: pglupgrade pglupgrade_pass: pglupgrade123 pglupgrade_database: postgres replica_user: postgres replica_pass: "" pgbouncer_user: pgbouncer postgres_old_version: 9.5 postgres_new_version: 9.6 subscription_name: upgrade replication_set: upgrade initial_standbys: 1 postgres_old_dsn: "dbname={{pglupgrade_database}} host={{groups['old-primary'][0]}} user={{pglupgrade_user}}" postgres_new_dsn: "dbname={{pglupgrade_database}} host={{groups['new-primary'][0]}} user={{pglupgrade_user}}" postgres_old_datadir: "/var/lib/postgresql/{{postgres_old_version}}/main" postgres_new_datadir: "/var/lib/postgresql/{{postgres_new_version}}/main" postgres_new_confdir: "/etc/postgresql/{{postgres_new_version}}/main" config.yml 13

1 2 3 How 5 4 Does It 6 12 13 Work? 7 8 9 11 14 15 10 16 14

1st Case: High Availability 15

1st Case: High Availability 16

2nd Case: Read Scalability 17

2nd Case: Read Scalability 18

Test Environment Amazon EC2 t2.medium instances 2 Virtual CPUs 4 GB of RAM for memory 110 GB EBS for storage pgbench scale factor 2000 PostgreSQL 9.5.6 PostgreSQL 9.6.1 Ubuntu 16.04 PgBouncer 1.7.2 Pglogical 2.0.0 19

Results Metric (1st case) pg_dump/pg_restore pg_upgrade pglupgrade Primary Downtime 00:24:27 00:16:25 00:00:03 Partial cluster HA 00:24:27 00:28:56 00:00:03 Full cluster capacity 01:02:27 00:28:56 00:38:00 Length of upgrade 01:02:27 00:28:56 01:38:10 Extra disk space 800 MB 27 GB 10 GB Metric (2nd case) pg_dump/pg_restore pg_upgrade pglupgrade Primary Downtime 00:23:52 00:17:03 00:00:05 Partial cluster HA 00:23:52 00:54:29 00:00:05 Full cluster capacity 00:23:52 03:19:16 00:00:05 Length of upgrade 00:23:52 03:19:16 01:02:10 Extra disk space 800 MB 27 GB 10 GB 20

Interpreting the Results Database size growth during logical replication initialization 21

Interpreting the Results Transaction rate and latency during standby cloning process 22

Interpreting the Results Transaction rate and latency during the upgrade process 23

Back to the Future Need for a near-zero downtime automated upgrade solution for PostgreSQL [ PgCon 2017 Developer Meeting] The tool will have a use in 2ndQuadrant and our customers PostgreSQL 10 will have built-in logical replication 24

Applicability Traditional data centers (bare-metal or virtual) Other Operating Systems (i.e Windows) Other DBMSs through logical replication (i.e MySQL, Oracle) Can work without PgBouncer 25

Limitations Spare resources on primary server (initial data copy) Cluster with too many writes (logical rep. catchup) Tables with PKs (or insert-only tables) - Postgres 10 No transparent DDL replication 26

Conclusion Database clusters can be upgraded with minimal downtime without users being affected while the upgrade is happening. An application can still respond to the request only with a small drop in performance. Case studies prove that pglupgrade minimizes the downtime to the level of 3-5 seconds. 27

Thanks! 28

Questions 29