the great debate: postgresql vs mysql

45
The Great Debate: PostgreSQL versus MySQL Jim Mlodgenski VP, Technical Services EnterpriseDB

Upload: enterprisedb

Post on 08-Sep-2014

13.879 views

Category:

Technology


0 download

DESCRIPTION

For years, the common industry perception has been that MySQL is faster and easier to use than PostgreSQL. PostgreSQL is perceived as more powerful, more focused on data integrity, and stricter at complying with SQL specifications, but correspondingly slower and more complicated to use. Like many perceptions formed in the past, these things aren\'t as true with the current generation of releases as they used to be.

TRANSCRIPT

Page 1: The Great Debate: PostgreSQL vs MySQL

The Great Debate: PostgreSQL versus MySQLJim MlodgenskiVP, Technical ServicesEnterpriseDB

Page 2: The Great Debate: PostgreSQL vs MySQL

Agenda

• Open Source Database Trends• PostgreSQL Strengths• PostgreSQL Weaknesses• MySQL Strengths• MySQL Weaknesses• Application Types• About EnterpriseDB

Page 3: The Great Debate: PostgreSQL vs MySQL

Agenda

• Open Source Database Trends• PostgreSQL Strengths• PostgreSQL Weaknesses• MySQL Strengths• MySQL Weaknesses• Application Types• About EnterpriseDB

Page 4: The Great Debate: PostgreSQL vs MySQL

Open Source Database Trends

Page 5: The Great Debate: PostgreSQL vs MySQL

Open Source Database Trends (cont.)

Page 6: The Great Debate: PostgreSQL vs MySQL

Open Source Database Trends (cont.)

Page 7: The Great Debate: PostgreSQL vs MySQL

Open Source Database Trends (cont.)

Battle for Open Source Database Dominance

Page 8: The Great Debate: PostgreSQL vs MySQL

Open Source Database Trends (cont.)

Battle for Database Dominance

Page 9: The Great Debate: PostgreSQL vs MySQL

Agenda

• Open Source Database Trends• PostgreSQL Strengths• PostgreSQL Weaknesses• MySQL Strengths• MySQL Weaknesses• Application Types• About EnterpriseDB

Page 10: The Great Debate: PostgreSQL vs MySQL

PostgreSQL Strengths

• Strong Advanced Feature Support

– Triggers, Stored Procedures, Rules– Server side languages

• SQL, Java, Ruby, Perl, Python, TCL, etc

– Point in Time Recovery– Table partitioning– Transactional DDL– Table Inheritance

Page 11: The Great Debate: PostgreSQL vs MySQL

PostgreSQL Strengths (cont.)

• Strong Security• Object Level Privileges assigned to “Roles & User”.

• Kerberos + SSL communication.

• Data Level Encryption (AES, 3DES, etc)

• Ability to utilise 3rd party Key Stores in a full PKI infrastructure

• Foundation for full compliance with some of the strictest of security standards (PCI Data Security Standard).

“By default PostgreSQL is probably the most security-aware database available”

David Litchfield - The Database Hackers Handbook

Page 12: The Great Debate: PostgreSQL vs MySQL

PostgreSQL Strengths (cont.)

• Data Integrity– Multi Version Concurrency Control– Write Ahead Logging– Online Backup– Foreign Keys– Constraints

Page 13: The Great Debate: PostgreSQL vs MySQL

PostgreSQL Strengths (cont.)

• Flexible BSD license

– Corporate IT developers can modify open source code under the BSD license without having to contribute back enhancements

– Independent Software Vendors are free to redistribute without the fear of being “infected” by an open source license

Page 14: The Great Debate: PostgreSQL vs MySQL

PostgreSQL Strengths (cont.)

• Strong Open Source Community– Independent & Thriving Development Community

• 10 committers and ~200 reviewers• 1,500 contributors and 10,000+ members • 2,000,000+ downloads

– 20 years of enterprise-class development

Page 15: The Great Debate: PostgreSQL vs MySQL

Agenda

• Open Source Database Trends• PostgreSQL Strengths• PostgreSQL Weaknesses• MySQL Strengths• MySQL Weaknesses• Application Types• About EnterpriseDB

Page 16: The Great Debate: PostgreSQL vs MySQL

PostgreSQL Weaknesses

• Lack of an integrated replication solution

– External solutions are required

– There is no agreed solution in the PostgreSQL community for the majority of replication requirements

– The current external solutions have a high learning curve

Page 17: The Great Debate: PostgreSQL vs MySQL

PostgreSQL Weaknesses (cont.)

• No upgrade facility for major releases

– The data must be either exported or replicated to the new version

• At least twice of the storage is needed during the upgrade process• On large datasets, an upgrade is a very time consuming process

Page 18: The Great Debate: PostgreSQL vs MySQL

PostgreSQL Weaknesses (cont.)

• Performance issues

– Indexes can not be used to directly return the results of a query

– Query execution plans are not cached

– Some update and delete operations leave expired data in the data files causing more IO

– Bulk loading operations may become CPU bound

Page 19: The Great Debate: PostgreSQL vs MySQL

PostgreSQL Weaknesses (cont.)

• Lack of experienced production talent – Many of the experienced

PostgreSQL administrators do not have experience in large corporate environments

Page 20: The Great Debate: PostgreSQL vs MySQL

PostgreSQL Weaknesses (cont.)

• Sparse Independent Software Vendor support

– There are few management and monitoring tools capable of using PostgreSQL

– When tools are available, many times it is through a generic ODBC or JDBC data source

– PostreSQL is Rarely the primarily database for an application, including open source applications

Page 21: The Great Debate: PostgreSQL vs MySQL

Agenda

• Open Source Database Trends• PostgreSQL Strengths• PostgreSQL Weaknesses• MySQL Strengths• MySQL Weaknesses• Application Types• About EnterpriseDB

Page 22: The Great Debate: PostgreSQL vs MySQL

MySQL Strengths

• Integrated Replication

– Master-Slave Replication• Scale-Out Implementations• Offload Reporting• Geographic Data Distribution

– MySQL Cluster• Horizontal Scalability

Page 23: The Great Debate: PostgreSQL vs MySQL

MySQL Strengths (cont.)

• Performance

– Low overhead MyISAM storage engine for read mostly applications

– Memory storage engine for frequently accessed tables

– Query Cache for frequently used statements

Page 24: The Great Debate: PostgreSQL vs MySQL

MySQL Strengths (cont.)

• Multiple Storage Engines

– Native Storage Engines• MyISAM• Merge• Memory• Federated

– Partner Developed Storage Engines• InnoDB• solidDB• Infobright

Page 25: The Great Debate: PostgreSQL vs MySQL

MySQL Strengths (cont.)

• Strong Corporate Backing

• Corporate Platinum Partners

Page 26: The Great Debate: PostgreSQL vs MySQL

MySQL Strengths (cont.)

• Popularity– Independent Software Vendor Support– Availability of experienced resources– Easily accessible information from various sources

such as whitepapers, blogs, and books

Page 27: The Great Debate: PostgreSQL vs MySQL

Agenda

• Open Source Database Trends• PostgreSQL Strengths• PostgreSQL Weaknesses• MySQL Strengths• MySQL Weaknesses• Application Types• About EnterpriseDB

Page 28: The Great Debate: PostgreSQL vs MySQL

MySQL Weaknesses

• Metadata uses MyISAM

– Transactions involving the system catalog are not ACID compliant

– A server crash can corrupt the system catalog

Page 29: The Great Debate: PostgreSQL vs MySQL

MySQL Weaknesses (cont.)

• Immature security model

– No pluggable authentication module preventing centrally managed accounts

– No support for roles resulting in difficulty in maintaining privileges for many users

Page 30: The Great Debate: PostgreSQL vs MySQL

MySQL Weaknesses (cont.)

• Immature server side programming model

– Stored procedures are not cacheable

– All tables used in the procedure or trigger are pre-locked

– All cursors are materialized

– Only supports SQL

Page 31: The Great Debate: PostgreSQL vs MySQL

MySQL Weaknesses (cont.)

• Scalability Problems

– Difficulty with increases in concurrency

– Difficulty with an increase in the number of cores in the server

Page 32: The Great Debate: PostgreSQL vs MySQL

MySQL Weaknesses (cont.)

• “Closed” Open Source Community

– The community is not contributing to the MySQL server code base

• It is currently very hard to contribute code and ideas

– There are not many MySQL developers that are also using MySQL

– Developers outside of MySQL do not have commit rights

– There are no new 'innovative' features in 5.1 from real life applications

Page 33: The Great Debate: PostgreSQL vs MySQL

Agenda

• Open Source Database Trends• PostgreSQL Strengths• PostgreSQL Weaknesses• MySQL Strengths• MySQL Weaknesses• Application Types• About EnterpriseDB

Page 34: The Great Debate: PostgreSQL vs MySQL

Application Types

• MySQL– Web 1.0 Type Applications

• The MyISAM storage engine is ideal for online catalog functionality

• Dynamic data is centered around an individual user such as user profiles and shopping carts

Page 35: The Great Debate: PostgreSQL vs MySQL

Application Types

• MySQL– Reporting and Data Warehousing

• The pluggable storage engine facility allows for enhanced business intelligence functionality

– Infobright

• The MyISAM storage engine has very low overhead for read intensive applications

Page 36: The Great Debate: PostgreSQL vs MySQL

Application Types

• MySQL– Commercial and Open Source Applications

• MySQL is the primary database for many of the popular open source projects

• Many commercial applications include MySQL in the demonstration versions

Page 37: The Great Debate: PostgreSQL vs MySQL

Application Types (cont.)

• PostgreSQL– Web 2.0 Type Applications

• The use of a distributed memory cache offloads many of the queries from the database resulting in a heavy transactional load

• The dynamic data such as forum posts and wikis are commonly being viewed by users while updates are occurring

Page 38: The Great Debate: PostgreSQL vs MySQL

Application Types (cont.)

• PostgreSQL– Operational Data Stores

• The data is constantly changing while reports executing

– Leverages the Multi Version Concurrency Control feature

• Multiple users running reports simultaneously requiring a scalable database

Page 39: The Great Debate: PostgreSQL vs MySQL

Application Types (cont.)

• PostgreSQL– New Application Development

• The numerous procedural languages allows developers to leverage existing knowledge

• Transactional DDL is almost a requirement in a Ruby environment

• Debugging server side code speeds the development process

Page 40: The Great Debate: PostgreSQL vs MySQL

Agenda

• Open Source Database Trends• PostgreSQL Strengths• PostgreSQL Weaknesses• MySQL Strengths• MySQL Weaknesses• Application Types• About EnterpriseDB

Page 41: The Great Debate: PostgreSQL vs MySQL

EnterpriseDB Company Facts

• Award-winning enterprise open source database company

• World’s largest concentration of PostgreSQL expertise including several core team members

• Founded in March 2004

• Headquartered in Edison, NJ and offices in 6 countries.

• Over 250 customers including: Sony, FTD, TDAmeritrade, British Telecom

• 65 partners including: Red Hat, Sun, IBM, Cognos, Compiere

Best Database Award2005, 2006 & 2007

Top 100 TechnologyCompanies

2006 “Ones to Watch”

Page 42: The Great Debate: PostgreSQL vs MySQL

Postgres Plus

Postgres Plus Advanced Server offers additional features including Oracle compatibility

Postgres Plus is fully open source and contains the PostgreSQL project along with additional components

Page 43: The Great Debate: PostgreSQL vs MySQL

Sample Customer Case Studies

Oracle-based Custom Applications• Sony replaced Oracle for on-line games, user forums, back-office

Oracle-based ISV• Tomax, retail industry ISV, replaced Oracle as default database

MySQL upgrade for Custom Applications• Vonage scaled applications from MySQL to EnterpriseDB

SQL Server upgrade by 3rd party ISV• Replaced SQL Server as embedded mammography database

Oracle-based Business Intelligence• Running Oracle Reports on EnterpriseDB; saved 80%

Page 44: The Great Debate: PostgreSQL vs MySQL

Contact Information

Jim MlodgenskiVP, Technical Services, EnterpriseDB

[email protected]

Page 45: The Great Debate: PostgreSQL vs MySQL

Thank you.