SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database needs

Post on 29-Jun-2015

158 views 3 download

Tags:

description

Talk by Chris Mair during SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database needs

Transcript of SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database needs

Schrödinger’s elephantwhy PostgreSQL can solve all your database needs

Chris Mairwww.1006.org

PostgreSQL

• Relational Database Management System

• SQL / transactions, procedural languages

• powerful, reliable, featureful, multi-platform

• Open Source / Free Software

• history (since 1995, but roots in the ’80)

amazing feature set

most of SQL:2011, ACID, transactional (including DDL!), excellent support for concurrent access (MVCC), clever statistics-based query optimizer, many indexing methods, stored procedures in PL/PgSQL and many other languages, foreign data wrappers (SQL/MED), many famous extensions such as PostGIS, ...

too boring?

(C) iStockphoto

NoSQL

• family of products that provide non-relational, non-SQL data storage and retrieval mechanisms, e.g. MongoDB:

- document store

- schema free

- JSON API

- sharding

MongoDB in action

teach new tricks to...

(C) iStockphoto

... elephants

JSONB in PG 9.4

• GIN index (same as used in full text search indexing) speeds up JSON operators

• PostgreSQL is now a hybrid database system - JSON document store + relational

• very fast performance: PostgreSQL 9.4 can outperform MongoDB 2.6 [entdb bench]

what else?

• unlogged tables (bypass transactional log for scratch data)

• XML

• full text search

• foreign data wrappers following SQL/MED (query external data: CVS file, other PostgreSQL database, MongoDB, ... ;)

need a herd?

Photo (C) Steve Evans - License: Creative Commons Attribution 2.0 Generic

• streaming replication: stream database operations to other nodes in real time (optionally as 2-safe replication - i.e. at least one slave has ack’ed)

• hot standby: issue queries on any slave node (including doing warm backups)

• instant failover: promote a hot standby node to master node with a single operation for high availability setups

• log shipping and point in time recovery: archive the transaction log on another node and restore to any point in time or transaction

the missing feature... :(

• no sharding / horizontal write scalability

... is under development :)

• BDR (bidirectional replication) [bdr]

• multi-master with optimistic approach: avoid conflicts where possible but allow some kind and resolve them using a last-update-wins strategy

• this is the “eventually-consistent” approach from the NoSQL-world, not the “cluster” approach from a prominent high-end RDBMS vendor

• available as 9.4 patch, eventually in core ;)

what about support?

(C) 123RF

support (free)!

• one of the friendliest communities (I like flames, so I know ;)

• superb documentation [docs]

• international mailing lists [ml int]

• italian mailing list [ml it] + user group [itpug]

support ($$$)!

• managed hosting is available, e.g. Amazon RDS and Heroku

• support is available in Italy too, e.g.2ndquadrant.com/it/

• proprietarily licensed variants with added features such as Oracle migration support are available, e.g. enterprisedb.com

< >SQL and NoSQL at the

same time

and you can open the box too!