SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database needs
-
Upload
south-tyrol-free-software-conference -
Category
Technology
-
view
162 -
download
3
description
Transcript of SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database needs
![Page 1: SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database needs](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/1.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/2.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/3.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/4.jpg)
too boring?
(C) iStockphoto
![Page 5: SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database needs](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/5.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/6.jpg)
MongoDB in action
![Page 7: SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database needs](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/7.jpg)
teach new tricks to...
(C) iStockphoto
![Page 8: SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database needs](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/8.jpg)
... elephants
![Page 9: SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database needs](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/9.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/10.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/11.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/12.jpg)
• 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](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/13.jpg)
the missing feature... :(
• no sharding / horizontal write scalability
![Page 14: SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database needs](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/14.jpg)
... 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](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/15.jpg)
what about support?
(C) 123RF
![Page 16: SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database needs](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/16.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/17.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062709/559034ef1a28ab0f2d8b46a4/html5/thumbnails/18.jpg)
< >SQL and NoSQL at the
same time
and you can open the box too!