elephants vs. dolphins: comparing postgresql and mysql for use in the dod

28
Elephant vs. Dolphin Comparing PostgreSQL and MySQL in the DoD James Hanson [email protected] [email protected] @jamey_hanson Freedom Consulting Group http://www.freedomconsultinggroup.com 14-Ju1-2015

Upload: jamey-hanson

Post on 16-Aug-2015

150 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Elephant vs. Dolphin

Comparing PostgreSQL and MySQL in the DoD

James Hanson

[email protected]

[email protected]

@jamey_hanson

Freedom Consulting Group

http://www.freedomconsultinggroup.com

14-Ju1-2015

Page 2: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

What are the similarities and differences between

PostgreSQL and MySQL?

Highlight features that support projects delivering

capabilities in our environment

Elephant vs. Dolphin in the DoD

PostgreSQL Migration Team 14-Jul-2015

2

vs.

Page 3: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

They are both Relational Database Management

Systems (RDBMS)

Store data in tables and views

Relate tables with foreign keys that are automatically

updated with triggers

Interact with data using ANSI SQL

Support procedural programming language(s)

Support "transactions"

COMMIT statement to make a permanent change

Support multiple, concurrent connections working with the

same data

How are PostgreSQL and MySQL similar?

PostgreSQL Migration Team 14-Jul-2015

3

Page 4: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

On-line ("hot") backups and database exports

Full or partial replication from Master to Standby

Including “hot” Standby for reporting

Multiple Standby with automatic failover

Clustering support with virtual IP interface

Command-line interface that can run scripts

Bulk load tools for OS files

Connection pooling tool(s)

Both have the expected suite of tools

PostgreSQL Migration Team 14-Jul-2015

4

Page 5: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

PostgreSQL Migration Team 14-Jul-2015

5

Both have a GUI

Page 6: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

PostgreSQL Migration Team 14-Jul-2015

6

Both have a GUI

Page 7: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Free and “freemium” versions

PostgreSQL has an active FOSS development

community.

MySQL FOSS development forked to MariaDB

EnterpriseDB only supports PostgreSQL.

Oracle also supports (protects) Oracle RDBMS

Both are included in CentOS / Fedora / RHEL

Similar distribution and business models

PostgreSQL Migration Team 14-Jul-2015

7

Page 8: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Dr. Google has multiple, conflicting performance

comparisons. An (over)simplification …

MySQL is considered to be slightly faster in simple

(i.e. no join) queries

PostgreSQL is faster in queries with joins and more

complex transactions

Similar performance

PostgreSQL Migration Team 14-Jul-2015

8

Page 9: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Magic Quadrant for Operational Database

Management Systems. http://www.gartner.com/technology/reprints.do?id=1-

23A415Q&ct=141020&st=sb

What does the Gartner say?

PostgreSQL Migration Team 14-Jul-2015

9

Page 10: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

What does the Gartner say?

PostgreSQL Migration Team 14-Jul-2015

10

Page 11: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Strategic planning assumptions

By 2017, the "NoSQL" label will cease to distinguish

DBMSs, which will reduce its value and result in it falling

out of use.

By 2017, all leading operational DBMSs will offer multiple

data models, relational and NoSQL, in a single platform.

EnterpriseDB (i.e. PostgreSQL) has higher

Completeness of Vision and Ability to Execute

What does the Gartner say?

PostgreSQL Migration Team 14-Jul-2015

11

Page 12: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

The MySQL™ software delivers a very fast, multi-

threaded, multi-user, and robust SQL (Structured

Query Language) database server. (https://dev.mysql.com/)

MySQL implements a subset of ANSI SQL and features

that are used by simple and (typically) ORM-based

applications.

PostgreSQL delivers a fast, robust implementation of

the ANSI SQL standard with NoSQL*, geospatial,

row-level-security and partitioning support. It is also

extensible with multiple programming languages.

* JSON, XML, key-value-pair, limited graph queries and natural

language full-text search.

Different missions and visions:

PostgreSQL Migration Team 14-Jul-2015

12

Page 13: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Why the passion?

13

MySQL PostgreSQL

Page 14: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Oracle owns MySQL, which effectively means it will never

have a feature set that competes with Oracle RDBMS.

Not everyone wants their database to support Larry’s

private island and America’s Cup

Business reasons …

PostgreSQL Migration Team 14-Jul-2015

14

Page 15: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

PostgreSQL’s mission is bigger than MySQL’s and

so it does more

Full implementation of ANSI SQL (vs. MySQL subset)

Native NoSQL support including JSON, XML, key-value-

pair and recursive (graph) queries.

Only Oracle RDBMS has these.

GeoSpatial support with PostGIS

Support for common language procedural extensions

Java, Python, Perl, Program/R

Application-customized data types including IPv4/6,

range, array and ENUM

Technical reasons …

PostgreSQL Migration Team 14-Jul-2015

15

Page 16: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Analytic functions (a.k.a. Windowing functions)

Calculate moving average and similar statistics that can

only be done in the application tier with MySQL

How does that impact my mission?

PostgreSQL Migration Team 14-Jul-2015

16

Page 17: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Find events within a user-select box, IP-location,

nearest event(s), event(s) within radius

Use internal mapping and related services … for free

GeoSpatial data

PostgreSQL Migration Team 14-Jul-2015

17

Page 18: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Validate IP’s on input (hard to do with IPv6)

Find IPs within subnet (CIDR notation) or range

Associate array’s of ports and/or MAC addresses

with IP(s)

PostgreSQL lets you think like a router when working

with IPs rather than thinking like a parser

IPv4 / 6 data types (+ MAC)

PostgreSQL Migration Team 14-Jul-2015

18

Page 19: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Beyond the Relational model for …

Large data sets that need to be stored efficiently

Focus on queries, relationships and analysis

(vs. transactions)

Read-only data

Does any of this sound applicable to our domain?

Arrays

PostgreSQL Migration Team 14-Jul-2015

19

Page 20: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Similar to Apache SOLR, but automatically updated

and part of the database

Not as fast or full-featured

Ranked results base on search-term frequency

weighted for document size. Similar to TF/IDF.

Highlighted surrounding phrases

Full-text search w/ranked results

PostgreSQL Migration Team 14-Jul-2015

20

Page 21: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Leverage the skills your team has today

(any) Procedural language support

PostgreSQL Migration Team 14-Jul-2015

21

Page 22: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Per Gartner – “By 2017, all leading operational DBMSs will

offer multiple data models, relational and NoSQL, in a single

platform.” (PostgreSQL does today)

JSON support similar to MongoDB, but integrated with the

rest of your data

NoSQL support … JSON & XML

PostgreSQL Migration Team 14-Jul-2015

22

Page 23: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

HSTORE data type stores key-value pairs as a column in a

relational table

NoSQL support … key value pair

PostgreSQL Migration Team 14-Jul-2015

23

Page 24: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

PostgreSQL recursive* queries support graphs. * “recursive”

is the ANSI-SQL term.

Similar functionality to Neo4J and SPARQL, but on smaller

data sets

NoSQL support … graph data

PostgreSQL Migration Team 14-Jul-2015

24

Page 25: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

PostgreSQL and MySQL are both good products for

simple, pure-relational applications using a subset of

ANSI-SQL

They have similar performance & tools

Both are free and “fremium”

But MySQL will never have the features of Oracle RDBMS

… because Larry Ellison won’t allow it.

MariaDB has FOSS active development, but it is a fork – not

MySQL

Summary

PostgreSQL Migration Team 14-Jul-2015

25

Page 26: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Consider PostgreSQL if, over the lifespan of your project,

you ever envision …

Using JSON, XML, key-value pair or other NoSQL data

Validating, storing or analyzing IPv4/6 or MAC addresses

Points on a map, selecting records based on a bounding-box,

searching for nearby/far-away records or looking for

communication that crosses a geographic boundary

Performing moving averages, Excel pivot-table queries or

advanced statistics

Leveraging your team’s Java, Python, Perl, TCL or Program /R

skills

Using (simple) graph analysis to find a path between records

Summary

PostgreSQL Migration Team 14-Jul-2015

26

Page 27: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Contact any member of the PostgreSQL Migration Team

James Hanson, Chris Fort and Russell Janusz

Connect to our YUM repository (or GUI installer) … and go

Contact Corporate Hosting … and let them host your

PostgreSQL database and VM

Contact Aaron Pestel or James Hanson for capability and

license information on EnterpriseDB

OK great … how do I move forward?

PostgreSQL Migration Team 14-Jul-2015

27

Page 28: Elephants vs. Dolphins:  Comparing PostgreSQL and MySQL for use in the DoD

Are

there

any

Questions

or

follow up?

PGConf US, NYC 26-

Mar-2015

28