Getting ready for PostgreSQL 9.1



Similar documents
Getting ready for PostgreSQL 9.1

The elephant called PostgreSQL

Data warehousing with PostgreSQL

PostgreSQL Features, Futures and Funding. Simon Riggs

Bruce Momjian June, Postgres Plus Technical Overview

High Availability Database Solutions. for PostgreSQL & Postgres Plus

Postgres Plus Advanced Server

MySQL és Hadoop mint Big Data platform (SQL + NoSQL = MySQL Cluster?!)

The Future of PostgreSQL High Availability Robert Hodges - Continuent, Inc. Simon Riggs - 2ndQuadrant

Using MySQL for Big Data Advantage Integrate for Insight Sastry Vedantam

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

Be Very Afraid. Christophe Pettus PostgreSQL Experts Logical Decoding & Backup Conference Europe 2014

Administering your PostgreSQL Geodatabase

How To Run A Standby On Postgres (Postgres) On A Slave Server On A Standby Server On Your Computer (Mysql) On Your Server (Myscientific) (Mysberry) (

The Advantages of PostgreSQL

PGCon PostgreSQL Performance Pitfalls

The Evolution of. Keith Alsheimer, CMO, EDB EnterpriseDB Corporation. All rights reserved. 1

PostgreSQL extension s development

plproxy, pgbouncer, pgbalancer Asko Oja

Implementing the Future of PostgreSQL Clustering with Tungsten

PostgreSQL Backup Strategies

PostgreSQL Past, Present, and Future EDB All rights reserved.

PostgreSQL 9.0 Streaming Replication under the hood Heikki Linnakangas

Backup and Recovery using PITR Mark Jones EnterpriseDB Corporation. All rights reserved. 1

Why Zalando trusts in PostgreSQL

Comparing MySQL and Postgres 9.0 Replication

High Availability with Postgres Plus Advanced Server. An EnterpriseDB White Paper

D61830GC30. MySQL for Developers. Summary. Introduction. Prerequisites. At Course completion After completing this course, students will be able to:

Weaving Stored Procedures into Java at Zalando


Database Management System Choices. Introduction To Database Systems CSE 373 Spring 2013

giovedì 4 ottobre 12

<Insert Picture Here> Oracle In-Memory Database Cache Overview

Keep an eye on your PostgreSQL clusters

Module 14: Scalability and High Availability

Postgres Plus xdb Replication Server with Multi-Master User s Guide

Module 7. Backup and Recovery

Active/Active DB2 Clusters for HA and Scalability

F1: A Distributed SQL Database That Scales. Presentation by: Alex Degtiar (adegtiar@cmu.edu) /21/2013

Greenplum Database. Getting Started with Big Data Analytics. Ofir Manor Pre Sales Technical Architect, EMC Greenplum

SQL Server 2012 and PostgreSQL 9

MySQL Technical Overview

Oracle Architecture, Concepts & Facilities

Backup and Restore Instructions. Backing up the Content Manager s Data

Firebird. A really free database used in free and commercial projects

Linas Virbalas Continuent, Inc.

PostgreSQL 9.0 High Performance

How to Dump and Restore Postgres Plus (R) Databases Using pgadmin. A Postgres Evaluation Quick Tutorial From EnterpriseDB

Real-time Data Replication

Open Source DBMS CUBRID 2008 & Community Activities. Byung Joo Chung bjchung@cubrid.com

Supported DBMS platforms DB2. Informix. Enterprise ArcSDE Technology. Oracle. GIS data. GIS clients DB2. SQL Server. Enterprise Geodatabase 9.

SQL Server What s New? Christopher Speer. Technology Solution Specialist (SQL Server, BizTalk Server, Power BI, Azure) v-cspeer@microsoft.

Database Replication with MySQL and PostgreSQL

Apache HBase. Crazy dances on the elephant back

MySQL Administration and Management Essentials

High Availability Solutions for the MariaDB and MySQL Database

High Availability Using Raima Database Manager Server

Java DB Performance. Olav Sandstå Sun Microsystems, Trondheim, Norway Submission ID: 860

Tips and Tricks for Using Oracle TimesTen In-Memory Database in the Application Tier

Agenda. ! Strengths of PostgreSQL. ! Strengths of Hadoop. ! Hadoop Community. ! Use Cases

PostgreSQL vs. MySQL vs. Commercial Databases: It's All About What You Need

Online Transaction Processing in SQL Server 2008

Introducing Ingres. HP OpenVMS Technical Update Days. Darren Horler. Manager, Engineering. October 2011

Doing More with Less: The Economics of Open Source Database Adoption

Course Outline: Course 6317: Upgrading Your SQL Server 2000 Database Administration (DBA) Skills to SQL Server 2008 DBA Skills

Microsoft SQL Database Administrator Certification

Oracle to SQL Server 2005 Migration

PRODUCT DOCUMENTATION. Greenplum Database. Version 4.3. Administrator Guide. Rev: A Pivotal Software, Inc.

Big Data Analytics Using SAP HANA Dynamic Tiering Balaji Krishna SAP Labs SESSION CODE: BI474

SQL Server Training Course Content

Scalability of web applications. CSCI 470: Web Science Keith Vertanen

A Shared-nothing cluster system: Postgres-XC

Programming Hadoop 5-day, instructor-led BD-106. MapReduce Overview. Hadoop Overview

Database migration. from Sybase ASE to PostgreSQL. Achim Eisele and Jens Wilke. 1&1 Internet AG

How, What, and Where of Data Warehouses for MySQL

How To Use Postgresql With Foreign Data In A Foreign Server In A Multi Threaded Database (Postgres)

Sharding with postgres_fdw

Scala InfoChannel Content Manager 5 Backup and Restore Instructions

Spring,2015. Apache Hive BY NATIA MAMAIASHVILI, LASHA AMASHUKELI & ALEKO CHAKHVASHVILI SUPERVAIZOR: PROF. NODAR MOMTSELIDZE

Upgrading Your SQL Server 2000 Database Administration (DBA) Skills to SQL Server 2008 DBA Skills Course 6317A: Three days; Instructor-Led

Implementing a Microsoft SQL Server 2005 Database

Real-time High Volume Data Replication White Paper

<Insert Picture Here>

SQL Server 2016 New Features!

Working with the Geodatabase Using SQL

SQL Server 2005 Features Comparison

Geodatabase Programming with SQL

Open PostgreSQL Monitoring

Stellar Phoenix. SQL Database Repair 6.0. Installation Guide

Pivotal Greenplum Database

<Insert Picture Here> Oracle Database Directions Fred Louis Principal Sales Consultant Ohio Valley Region

CitusDB Architecture for Real-Time Big Data

Transcription:

Getting ready for PostgreSQL 9.1 Gabriele Bartolini <Gabriele at 2ndQuadrant.com> http:///

License Creative Commons: Attribution-NonCommercial-ShareAlike 3.0 You are free: to Share to copy, distribute and transmit the work to Remix to adapt the work Under the following conditions: Attribution: You must attribute the work in the manner specified by the author or licensor Non-Commercial: You may not use this work for commercial purposes Share Alike: If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one Source: http://creativecommons.org/licenses/by-nc-sa/3.0/

About myself Founder of 2ndQuadrant Italia Database architect at 2ndQuadrant Business Critical OLTP databases Data warehousing PostgreSQL user for over 10 years Founder of PostgreSQL Europe Former Vice President Founder of the Italian PostgreSQL Users Group Current President

About 2ndQuadrant Professional Open-Source Software House Platinum sponsor of PostgreSQL 100+ customers worldwide Directly represented in 5 countries Special coverage in Latin America and Nordic Countries 24x7 support for PostgreSQL production environments What we do Design, Develop and Support PostgreSQL We deliver high quality professional services Leaders in HA, Recovery, Scalability and Performance Training

Who's using PostgreSQL?

Table of contents The PostgreSQL Project PostgreSQL 9.0 PostgreSQL 9.1

Part I The PostgreSQL Project

Postgres or PostgreSQL? Officially it is PostgreSQL Postgres was the initial name of the project With SQL support (1996) the project changed name into PostgreSQL Postgres is commonly accepted as a synonym

PostgreSQL and its key features Open-Source Database Management System Close support of the SQL Standard (SQL:2008) Multi-Version Concurrency Control Multi-user, designed for concurrency Extensibility: Data types Functions

Applications, databases and DBMS Software applications Software applications SQL DBMS

100% Open-Source and Community Distributed under a BSD-like license The PostgreSQL License (TPL) http://www.opensource.org/licenses/postgresql Highly permissive Not subject to change of licensing It will always be open-source Not subject to acquisitions A community project

The PostgreSQL ecosystem Community Developers Users End users Companies and organisations Consulting companies Individuals Sponsors Development External Stakeholders Companies that sponsor the development of key features

A mature project PostgreSQL has been developed for over 25 years It is an adult It is even allowed to drink (in some countries) It has grown rapidly in popularity Particularly in the last 3 years OpenStreetMap moved to Postgres (2009) Provider of support for Solaris changed (2010)

PostgreSQL releases Current stable release: 9.0.4 (18 April 2011) Current Major release: 9.0 (September 2010) 5 major releases in the last 5 years Oldest supported release: 8.1 (2005) On Windows: 8.2 Major releases supported by the community: 8.1, 8.2, 8.3, 8.4 and 9.0 PostgreSQL 9.1 is expected later this year Currently 9.1.0beta2 is out

Part II PostgreSQL 9.0

Architecture Client / Server Multi-processing ANSI C Uses stable system functions Multi-platform

Typical use cases Transactional databases (OLTP) Telecommunications E-Commerce Monitoring of electronic devices ERP, CRM, data warehousing, BI Social networking platforms High traffic websites Geographical Information Systems (PostGIS) Web CMS, Blog systems etc.

A versatile product Multiple interfaces for connectivity: Native, JDBC, Python, Perl, PHP, ODBC,.Net,... Multiple server languages: PL/pgSQL, PL/Python, PL/Perl, PL/Java, ecc. User, path, options, environment

Cool robust features Views Stored procedures Triggers Column and/or conditional ACID transactions Schemas Tablespaces Partitioning Custom types Rules

Security and data protection Concept of security by default Multi-level security model server, database, table, column SSL Integration with the company's security infrastructure Full disclosure of vulnerabilities Rapid fix of security bugs

Features for web technologies Support for SQL:2008 Support for the UNICODE standard (UTF-8 charset) Support for regular expressions Support for XML Database level collation Localisation

Advanced web features Full text search Arrays Transparent compression of text data Data types (enums, uuid, cidr, macaddr, hstore,...) Session parameters with SET Asynchronous commit

Business critical environments Two of the major challenges and requirements: Maximise the uptime ( 5 Nines = ~ 5 minutes/year) Reduce downtimes Remove data loss While keep data consistent (always)

PostgreSQL's answer Robustness and reliability WAL Files Hot backup Online Backup and Point in time recovery High Availability Warm/Hot Standby Asynchronous Streaming Replication Synchronous Streaming Replication (9.1!)

Warm standby Technology for asynchronous replication based on: Write Ahead Log (WAL) files shipping Through operating system commands (e.g. rsync) 1 primary node, N secondary nodes Secondary nodes: Are called standby nodes Do not accept connections Are an almost identical copy of the master Small delay due to WAL shipping High Availability technology The standby is promoted in case of failover (unexpected) or switchover (deliberate)

Warm Standby, overview Host A Host B Primary database Warm Standby database replay WAL Data Log shipping Base backup WAL Data

Hot Standby Host A Primary database Host B Log shipping Standby database Continuous recovery Software applications

Streaming Replication Host A Host B Primary database Warm/Hot Standby database WAL WAL Sender Data replay Stream Base backup WAL Receiver Data

More replication solutions Not part of PostgreSQL's core Only available solutions for PostgreSQL < 9 A few alternatives Slony PGPool Bucardo Londiste (Skype)

VLDB Many 1TB+ databases with PostgreSQL Typical usage is 100GB+ databases Key features: SMP architectures Tablespaces Horizontal partitioning

Scalability Caching: pgmemcache integration with memcache Distribution on multiple nodes: PgBouncer (connection pooling) PL/Proxy Map/Reduce (RUN ON ALL, ANY, single node)

Administration and monitoring tools Command line: psql, pg_dump, pg_restore, ecc. GUI: PgAdmin3 Web: PHPpgAdmin Alerting: Nagios integration Monitoring: Cacti and Munin integration Replication: repmgr (devel)

Spatial extension: PostGIS PostgreSQL's most important extension Geographical Information System (GIS) OpenStreetMap Add geographical data types Open Geospatial Consortium Geodatabase

Part III PostgreSQL 9.1

Overview Improvements in operations Extensions packaging New features and performance improvements in key areas Synchronous Replication Triggers on views ( updatable views ) Column collations Writable CTE Serializable Snapshot Isolation Better partitioning...

Synchronous Replication Data loss prevention technology Uses streaming replication Performance downgrade Main concept: A transaction is written on >=1 standby servers before COMMIT Priority ordered list of servers Identified by their application_name synchronous_standby_names = '*' synchronous_standby_names = 'slave1, slave2, slave3' Can be controlled at several levels: Transaction, session, user, database, server SET synchronous_commit TO off;

Example of transaction control SET synchronous_commit TO off; BEGIN; -- I could not care less INSERT INTO bands ('Take that'); INSERT INTO bands ('Black Eyed Peas'); COMMIT; SET synchronous_commit TO on; BEGIN; -- Extremely important! INSERT INTO bands ('AC/DC'); INSERT INTO bands ('Cream'); COMMIT;

Synchronous Replication Host A Host B Primary database Warm/Hot Standby database WAL WAL Sender Data replay Stream Feedback Base backup WAL Receiver Data

A few improvements from 9.0 pg_basebackup Improved monitoring Views, including pg_stat_replication Feedback from Hot Standby servers to the master about running read-only queries Prevents query cancellation (VACUUM on master) Allows to pause/resume replication on slaves

Extensions before 9.1 Extensibility has been a key feature in PostgreSQL With one limitation: No dump/restore support No special attention for their objects Issues with upgrades pg_dump cannot distinguish extensions' object from the rest of the objects Extensions, including functions, are included in the dump Sometimes this can be a mess

Extensions from now on pg_dump is now able to produce only this: CREATE EXTENSION IF NOT EXISTS extname Programmers can define their own extensions through a control file, which specifies metadata and contained objects Version, SQL files directory, modules path, dependencies, More commands: DROP EXTENSION extname ALTER EXTENSION extname UPDATE PGXN: PostgreSQL Extension Network (pgxn.org)

Example of extensions: PGMP Homepage: http://pgmp.projects.postgresql.org/ pgmp.control file default_version = '1.0' comment = 'Multiple Precision Arithmetic extension' directory = 'pgmp' relocatable = cd true

Column level collations Collations control how to perform character comparisions within strings Crucial in non English speaking countries Think about Europe! You can now specify different collations inside the same table, at column level CREATE TABLE collate_example ( c_text TEXT COLLATE ucs_basic, en_text TEXT COLLATE "en_en.utf8", it_text TEXT COLLATE "it_it.utf8" );

Example of collations SELECT it_text FROM collate_example ORDER BY c_text; SELECT it_text FROM collate_example ORDER BY it_text; a e i à é a à e é i

Triggers on views CREATE TRIGGER trigger_name INSTEAD OF event ON view_name FOR EACH ROW; Events: INSERT UPDATE DELETE Allows views to be UPDATEABLE

Unlogged tables CREATE UNLOGGED TABLE Do not produce any WAL content Not crash safe (TRUNCATE on recovery) Their content is not replicated Just the schema Typical use case: Caching Storage of Web temporary sessions Differences with temporary tables They go beyond a session's lifetime Global namespace and visibility

Foreign tables Part of SQL/MED Prior to 9.1: dblink, DBI-link, PL/Proxy Foreign data wrapper API (FDW) CREATE FOREIGN TABLE Currently only one example as contrib file_dw (foreign data wrapper for reading CSV files) Exposes a CSV as a FOREIGN TABLE in the database Supports only SELECT Mainly a test case to show the potential of the API It will be improved from 9.2

Writeable Common Table Expressions Improvement to WITH queries introduced in 8.4 Support for write queries within the WITH clause WITH d AS ( DELETE * FROM log WHERE logday = '2011-06-01' RETURNING * ) INSERT INTO old_log SELECT * FROM d;

Other important changes Serialisable Isolation Level Great feature (too complex to talk about it now!) Optimization of queries that use ORDER BY, LIMIT, or MIN/MAX with inherited tables K-Nearest Neighbour GIST Standard conforming strings By default: \' (escaping) throws an error (use '') format() (for sprintf lovers!) SE-Linux Integration for PostgreSQL and more For a full list of changes, see the Release Notes

Conclusions PostgreSQL allows a database to be: Fast Consistent Reliable Secure Integrable Available Recoverable

and reduces the costs No license fee Simple license model No dual licensing headaches Reduces the total cost of ownership (TCO) for a database solution Invest in knowledge Removes any vendor lock-in / monopolisation Largest community for an open-source database management system project

Let's make the Elephant happy!

Questions?

Thank you You can contact Gabriele via email at Gabriele@2ndQuadrant.com For more information on our professional services on PostgreSQL and Greenplum, visit our website http:/// See you next year!