sfscon14: schrödinger’s elephant: why postgresql can solve all your database needs

18
Schrödinger’s elephant why PostgreSQL can solve all your database needs Chris Mair www.1006.org

Upload: south-tyrol-free-software-conference

Post on 29-Jun-2015

158 views

Category:

Technology


3 download

DESCRIPTION

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

TRANSCRIPT

Page 1: 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

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

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)

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

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, ...

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

too boring?

(C) iStockphoto

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

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

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

MongoDB in action

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

teach new tricks to...

(C) iStockphoto

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

... elephants

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

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]

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

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, ... ;)

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

need a herd?

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

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

• 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

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

the missing feature... :(

• no sharding / horizontal write scalability

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

... 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 ;)

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

what about support?

(C) 123RF

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

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]

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

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

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

< >SQL and NoSQL at the

same time

and you can open the box too!