postgres advances on nosql

29
© 2014 EnterpriseDB Corporation. All rights reserved. 1 You (probably) don’t need NoSQL (with Postgres) May 2014

Upload: enterprisedb

Post on 08-Sep-2014

9.506 views

Category:

Software


3 download

DESCRIPTION

PostgreSQL community co-founder Bruce Momjian, an EnterpriseDB Senior Database Architect, and Marc Linster, SVP, Products and Services will explain: What NoSQL technologies are and the use cases they address Advances in recent Postgres releases that deliver NoSQL-like functionality What to consider when considering a specialized solution Insight from Bruce and Marc on why leveraging Postgres can be a better choice Visit www.Enterprisedb.com/Resources for the presentation recording. To speak with someone, please email us at [email protected].

TRANSCRIPT

Page 1: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 1

You (probably) don’t need NoSQL (with Postgres) May 2014

Page 2: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 2

•  Marc Linster −  Senior Vice President, Products and

Services, EDB

EDB Presenters

•  Bruce Momjian −  EDB Senior Database Architect −  Core contributor to PostgreSQL −  Co-founder of the PostgreSQL Global

Development Group

Page 3: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 3

•  Address NoSQL technologies & associated workloads •  Explore Postgres NoSQL capabilities •  Help you understand your needs

Objectives

Page 4: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 4

NoSQL Lessons from the ‘Asphalt Jungle’

Page 5: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 5

•  Where did the Humvee come from? −  Where cool stuff always comes

from – the US military

•  Why did they make Humvees? −  The military needed “Jeeps on

Steroids”

Let’s Ask Ourselves …

•  What does the Humvee accomplish? −  It carries troops safely, reliably and (arguably) comfortably (beats

walking)

•  Why did they have to build it? −  The old Army Jeeps couldn’t cut it

Page 6: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 6

•  Where did NoSQL come from? −  Where all cool tech stuff comes from – Internet companies

•  Why did they make NoSQL? −  To support larger data loads and evolving demands for ways

to work with new data types

•  What does NoSQL accomplish? −  Enables you to work with bigger loads and new data types:

email, mobile interactions, machine data, social connections

•  Why did they have to build something new? −  There were limitations to most relational databases

Let’s Ask Ourselves, Why NoSQL?

Page 7: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 7

I Need One! (You Want One)

Page 8: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 8

•  There are four major NoSQL technologies −  Key-value stores, e.g. Redis −  Document databases, e.g. MongoDB (JSON) −  Columnar stores: Cassandra −  Graph databases: Neo4j

•  They all take different approaches and have different features and drawbacks

Now You Too Can Have One of Your Own!

Page 9: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 9

•  Massive write scaling is required, more than what a single server can provide

•  Only simple data access pattern is required

•  It’s acceptable to allocate additional resources •  Strong data retention or transactional guarantees are

not required

•  Unstructured duplicate data is acceptable −  Application handles duplicate data issues −  Compression can also help

You Might Need a Hummer When …

Page 10: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 10

•  Ferry around a whole soccer team −  Manage huge data dumps of log files

•  Tell your neighbors (and maybe an ex) something about yourself −  Analyze customer transactions

•  Ride out a snowstorm −  Web session data where scaling is an

issue

Because Your Hummer Can …

•  Power up when you need to Drive Big and you just don’t care −  Massive amounts of data and lots of concurrency (and little need

for durability)

Page 11: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 11

A Place for Hummer - Real-world Apps

•  Emergency Management System −  High variability among data sources required high schema

flexibility

•  Massively Open Online Course −  Massive read scalability, content integration, low latency

•  Patient Data and Prescription Records −  Efficient write scalability

•  Social Marketing Analytics −  Map reduce analytical approaches

Source: Gartner, A Tour of NoSQL in 8 Use Cases, by Nick Heudecker and Merv Adrian, February 28, 2014

Page 12: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 12

•  Features and functions of relational databases were confining, so NoSQL sacrifices: −  A powerful query language −  A sophisticated query optimizer −  Data normalization −  Joins −  Referential integrity −  Durability

But, You Give Up a Few Things

Page 13: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 13

•  Reporting is Difficult −  Data must be brought to the client

for analysis, e.g. no aggregates or data analysis functions

−  Schema-less data requires complex client-side knowledge for processing

So, Try Parking One

Page 14: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 14

•  Application design is more complex −  Without powerful query language and query optimizer, the

client software is responsible for efficiently accessing data and for data consistency

−  The application is in charge of managing data duplication and referential integrity

How About Finding a Good Mechanic?

−  Core logic in the application introduces maintenance and consistency headaches

Page 15: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 15

•  Durability is not part of the database −  No ACID compliance means administrators are responsible for

data retention

And, Take Nothing for Granted

Page 16: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 16

Oh, And the Gas Mileage Was an Issue

Page 17: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 17

Here is What You Do Need

Page 18: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 18

Reliable, Stylish–And Has a Few Tricks

Page 19: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 19

Postgres has many NoSQL features without the drawbacks: •  Do some off-road riding

−  Schema-less data types, with sophisticated indexing support

•  Switch to four-wheel drive on the fly −  Transactional schema changes with rapid additional and

removal of columns

Postgres: The Best of Both Worlds

•  Great options packages −  Durable by default, but

controllable per-table or per-transaction

Page 20: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 20

•  Postgres was originally architected to be an object-relational database

•  Extensible (e.g. PostGIS extension for geospatial)

•  Supports objects and classes in the schemas and

Key Qualities Give Postgres NoSQL Powers

query language •  Supports custom

data types and methods

Page 21: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 21

•  JSON is the most popular data-interchange format on the web today

•  Supported by virtually every programming language

•  New supporting technologies (also supported by Postgres) continue to expand JSON’s utility −  PL/V8 JavaScript extension −  PL/Coffee V8 extension −  Node.js

•  Postgres has a native JSON data type (v9.2) and a JSON parser and a variety of JSON functions (v9.3)

•  Postgres will have a JSONB data type with binary storage and indexing (coming – v9.4)

Postgres: Document Store

Page 22: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 22

•  Supported since 2006, the HStore contrib module enables storing key/value pairs within a single column

•  Allows you to create a schema-less, ACID compliant key value store within Postgres

Postgres: Key-value Store

•  Combines flexibility with ACID compliance

•  Create single HStore column and include, for each row, only those keys which pertain to the record

•  Add attributes to a table and query without advance planning

Page 23: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 23

•  The spirit of open source community has led to the development of Foreign Data Wrappers

•  Foreign Data Wrappers (SQL MED) allow queries to read and write data to foreign data sources.

•  Foreign database support includes: −  CouchD, Informix, MongoDB, MySQL −  Neo4j, Oracle, Postgres, Redis

Database Federation with Postgres

Page 24: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 24

•  NoSQL = Non-durable tables •  Postgres = Unlogged tables •  With v9.1, Postgres introduced the capacity to prioritize

data for recovery should the system fail in exchange for better application performance

Durability and Performance Trade-offs in Postgres

Page 25: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 25

Ask yourself if you need the following: •  ACID compliance •  Relationships among data

•  Reporting demands •  The ability to interface with other data sources

Do YOU Need NoSQL?

Page 26: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 26

•  Postgres is Not Only SQL (NoSQL is No SQL) •  Fully ACID compliant •  Proven track record

•  Fully capable of handling the variety, velocity and volume requirements of most applications

•  Tackle NoSQL projects without leaving the capabilities of the relational model behind you

Postgres is the best of both worlds, and it’s open source!

Say ‘Yes’ to ‘Not Only SQL’

Page 27: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 27

•  Document store with ACID and relational capabilities

•  Decades-long track record of quality and stability

•  TCO cost avoidance from new systems: −  Operational support −  Duplicated storage −  Software upgrades −  Monitoring & management −  Hardware −  Training −  Additional staffing

Expand the role of your workhorse relational DBMS to include many NoSQL use cases. Use specialized technologies for edge cases when required.

Why Choose When You Can Have Both?

Page 28: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 28

POSTGRES innovation

ENTERPRISE reliability

24/7 support

Services & training

Enterprise-class features & tools

Indemnification

Product road-map

Control

Thousands of developers

Fast development

cycles

Low cost

No vendor lock-in

Advanced features

Enabling commercial adoption of Postgres

Page 29: Postgres Advances on NoSQL

© 2014 EnterpriseDB Corporation. All rights reserved. 29