SlideShare una empresa de Scribd logo
1 de 46
Descargar para leer sin conexión
Two great open source
databases: a comparison

                 Josh Berkus
                 PostgreSQL Core Team
                 HP Tux Talks, June 26, 2008
Who is Josh?
●   PostgreSQL Core Team
    –   10 years involvement with the project
    –   Large database performance, tuning, project press
        & corporate relations, user groups
●   Database geek
    –   15 years database application development
    –   MS SQL, MySQL, Oracle, others
●   Open Source guru
    –   OpenOffice.org, LedgerSMB, Bricolage, OpenBRR,
        OSCON, more
Topics
●   Sound Bite
●   History
●   Most Common Uses
●   Features
●   Performance
●   Summary
Topics
●   Sound Bite
●   History




                               QL t
    Most Common Uses




                             eS ou
●




                           gr ab
●   Features




                         st ly
                       Po t
    Performance


                          os
●




                       m
●   Summary
Sound Bite


    "The most popular open source database"
              "The web database"




"The world's most advanced open source database"
            "The open source Oracle"
History of MySQL
●   MySQL Server development started in 1994,
    marketed by TCX DataKonsult AB
●   MySQL AB founded in 1995 by Michael
    “Monty” Widenius, David Axmark and Allan
    Larsson
●   Server development based on requirements
    for practical production use: few features, but
    fast and stable
●   Frequent releases with small changes
●   Easy to install and use (15-minute rule)
History of PostgreSQL
• 1986: POSTGRES at the University of California, Berkeley
  > Michael Stonebraker project
  > Successor to INGRES
• 1994: first commecialized
  > as Illustra (later merged into Informix)
• 1995: open-sourced
  > Ported to SQL
  > PostgreSQL Global Development Group formed
• 1997: ported to Japanese, supported in Japan
• 1999: first full-time developers & corporate support
• 2004: native Windows support
• 2006: supported by Sun
Development History


Designed by/for Application Developers




Designed by/for Database Administrators
Development Priorities
                   (historically)

PostgreSQL                  MySQL
1.Data integrity            1.Ease-of-use
2.Security                  2.Performance
3.Reliability               3.Programmer Features
4.Standards                 4.Reliability
5.DB Features               5.DB Features
6.Performance               6.Data integrity
7.Ease-of-use               7.Security
8.Programmer Features       8.Standards
Development Direction
                (a simplification)




               MySQL


               PostgreSQL
Simple,                              Features,
Easy to Use,                         Security,
Fast                                 Standards
Community


 Owned by one company with user community




Community-owned with many companies involved
●   Core MySQL is 100% owned by Sun/MySQL
●   90% of MySQL developers work for Sun
    –   except for the many storage engines
●   MySQL has a large user community
    –   many thousands active worldwide
    –   many partners in other open source groups
●   Sun/MySQL contributes to other OSS projects
    –   PHP especially
●   PostgreSQL has a large distributed
    developer and user community
●   Not owned by any one company
    –   dozens of companies and individuals
        contribute code
    –   est. over 200 developers in 14 time
        zones
●   "Community Owned"
    –   supported by 5 different non-profits
PostgreSQL Community Map

                 Hackers

 Projects
            Committers            User Groups
                                       and
              Co                 National Groups
                 re        Advocacy

     Companies
                                      Foundations
Most Common Uses


●   Web sites           ●   ERP
●   CRM                 ●   Data Warehouse
●   Logging             ●   Geograpic
●   OEM applications    ●   Web Sites
●   Telecom (cluster)   ●   OEM applications
●   Network tools       ●   Network tools
●   Data Warehouse      ●   CRM
Releases


●   Feature-based
    releases                    ●   Time-based releases
    –   new features in minor       –   no new features in
        releases                        minor releases
    –   every 1-3 years             –   every year
         ●   3.23: 2000                  ●   7.4: 2003
         ●   4.0: 2003                   ●   8.0: 2004
         ●   4.1: 2004                   ●   8.1: 2005
         ●   5.0: 2005                   ●   8.2: 2006
         ●   5.1: 2008?                  ●   8.3: 2008
Features
Storage Engines
●   Pluggable "Storage Engines" allow MySQL to
    behave like a variety of different databases
    –   Telecom DB: MySQL Cluster
    –   Non-transactional: MyISAM
    –   Transactional: InnoDB
    –   Compressed: Archive
    –   In-Memory: Memory
    –   Write-only: Blackhole
Programmer Features
●   Excellent drivers for all languages
    –   including JDBC4
●   PHP
    –   high-performance drivers & special syntax
    –   Native driver
●   MySQL Proxy
3rd Party Support
●   Most open source web projects default to
    MySQL
    –   many use only MySQL
    –   primary relational database for most top 25 web
        sites
●   Hundreds of vendors support MySQL
    –   more than 50% of multi-database products
    –   many "MySQL Partners"
MySQL Scale-Out
●   Simple Replication makes it (relatively) simple
    to scale out
    –   used by Google, Yahoo
    –   load-balance reads on slaves
    –   being supplanted by memcached

                                            Master

                                   Writes

                                   Reads    Slave
        Requests
                                   Reads
                   Load Balancer
                                            Slave
Simplicity
●   Easy to set up
    –   "15 minute rule"
    –   everything included
●   Easy to administrate
    –   programmer-administered
    –   most installations don't need tuning
●   Easy Replication
    –   very simple master-slave & multimaster replication
Features
Migrateability
●   Closest to proprietary enterprise DBs
●   Automatic migration from Informix
    –   Informix is 50% PostgreSQL
●   Relatively easy migration from Oracle
    –   easiest of any OSS database
    –   puts migration cost within affordable range
    –   tools for data integration
●   SQL Server, DB2 harder
    –   but easier that MySQL
Security


"... by default, PostgreSQL is
the most security-aware
database available ..."

    Database Hacker's Handbook
(based on a comparison of PostgreSQL,
  MySQL, Oracle, DB2 and SQL Server)
Security
●   Authentication
    –   multiple methods: login, SSL, Kerberos, more
    –   host-based authentication
●   Logging
    –   log output is highly configurable and supports user
        auditing
●   Permissions model
    –   SQL ROLES supported, including nested roles
    –   multiple settable permissions on all database
        objects
Security
●   Clean code
    –   only one security patch per two months
    –   community patches usually out in less 72 hours
    –   only one exploit in the field in the last four years
●   DB Auditing
    –   PostgreSQL supports highly configurable triggers
        and other DB automation
    –   No “auditing toolkit” out yet
Transaction Support
●   "Bulletproof" ACID thanks to MVCC
    –   possibly best of any RDBMS
●   Transactional DDL
    –   apply schema changes in a transaction
    –   great for change management
         ●   including agile development
●   Savepoints
    –   spec-compliant "subtransactions"
BI/DW Features
●   Large database management features
    –   tablespaces, table partitioning
    –   automatic large field/row compression
●   Powerful query planner & executor
    –   complex queries with nested subselects, outer joins
        and calculated fields
    –   large many-table joins with multiple join types
●   Data mining features
    –   full text indexing and regex support
    –   embed external language DM modules
BI/DW Features
select a12.DAY_OF_WEEK_NBR AS DAY_OF_WEEK_NBR,
   max(TO_CHAR(a12.DATE_DESC ,'Day')) AS CustCol_6,
   a11.DATE_ID AS DATE_ID,
   max(a12.DATE_DESC) AS DATE_DESC,
   a11.FI_ID AS FI_ID,
   max(a13.FI_NAME) AS FI_NAME,
   a12.WEEK_YEAR_ID AS WEEK_YEAR_ID,
   max(a14.SHORT_WEEK_DESC) AS SHORT_WEEK_DESC,
   sum (session_count) AS WJXBFS1,
   sum ( a11_count ) AS WJXBFS2
from   ( SELECT DATE_ID, FI_ID, count(distinct SESSION_ID) as
session_count, COUNT(*) as a11_count
       FROM edata.WEB_SITE_ACTIVITY_FA
       WHERE DATE_ID in (2291, 2292, 2293, 2294, 2295)
       GROUP BY DATE_ID, FI_ID )
       a11
   join    edata.DATE_LU a12 on   (a11.DATE_ID = a12.DATE_ID)
   join    edata.DIM_FI a13 on    (a11.FI_ID = a13.FI_ID)
   join    edata.WEEK_LU a14 on   (a12.WEEK_YEAR_ID = a14.WEEK_YEAR_ID)
group by a12.DAY_OF_WEEK_NBR,
   a11.DATE_ID,
   a11.FI_ID,
   a12.WEEK_YEAR_ID
Extensibility
●   Create your own database objects
    –   almost any db object can be extended easily:
         ●   functions
         ●   types
         ●   operators
         ●   aggregates
         ●   pseudo-tables
    –   user-created objects are (usually) first class objects
●   everything is a function
    –   12 different function languages
Extensibility
CREATE OR REPLACE FUNCTION _choose_random_text (
     thestate _random_text,
     newvalue TEXT )
 RETURNS _random_text AS $f$
 DECLARE result _random_text;
 BEGIN
     result.runcount := COALESCE(thestate.runcount, 0) + 1;
     IF random() < ( 1::FLOAT / result.runcount::FLOAT ) THEN
          result.choice := newvalue;
     ELSE
          result.choice := thestate.choice;
     END IF;
     RETURN result;
 END; $f$ LANGUAGE plpgsql;      CREATE AGGREGATE random_agg(
                                     BASETYPE = text,
                                     SFUNC = _choose_random_text,
                                     STYPE = _random_text,
                                     FINALFUNC = _exit_random_text
                                );
Special Data
●   Base Types:                 ●   Exotic types
    –   char, varchar               –   geometric: polygon, line
    –   large text                  –   GIS (through PostGIS)
    –   numeric                     –   crypto
    –   integers                    –   ISN & ISBN
    –   floats                      –   XML
    –   time, date, timestamp       –   network: INET, CIDR
    –   bytea (for binary)          –   arrays
                                    –   full text index
                                    –   genome
Special Data: GIS
Special Data: genomics
●   BLASTgres,
    Unison
    Protein
    Database
Procedural Languages
●   Use the language you prefer, inside the
                             –

    database:
    –   SQL                   –   Java
    –   PL/pgSQL              –   shell
    –   C                     –   R
    –   C++                   –   PHP
    –   Perl                  –   Ruby
    –   Python                –   Tcl

●   In beta now: PSM, Lua
PL/pgSQL
create or replace function _set_self_paths ( )
returns trigger as $f$
declare parrec RECORD;
     has_kids BOOLEAN;
begin
     --prevent setting order_by too high
     EXECUTE 'SELECT * FROM ' || TG_RELNAME || ' WHERE id = ' || CAST(NEW.parent as
TEXT)
          INTO parrec;
     IF parrec.id is not null THEN
          NEW.path := parrec.path || (NEW.id::TEXT);
          NEW.order_path := parrec.order_path || to_char(NEW.order_by, 'FM0000');
          NEW.show_path := parrec.show_path || ' / ' || NEW.name;
     ELSE
          NEW.path := text2ltree(NEW.id::TEXT);
          NEW.order_path := text2ltree(to_char(NEW.order_by, 'FM0000'));
          NEW.show_path := NEW.name;
     END IF;
RETURN NEW;
end;
$f$ language plpgsql;
PL/Perl
CREATE FUNCTION "if_strip_numeric"
(text,smallint) RETURNS text AS $f$
my($the_text, $cutoff) = @_;
$the_text =~ s/[^0-9]/""/eg;
if ( $cutoff > 0 ) {
  $the_text =
    ( substr $the_text, 0, $cutoff );
}
return $the_text;
$f$ LANGUAGE plperl IMMUTABLE, STRICT;
PL/R

create or replace function statsum(text)
returns summarytup as '
 sql<-paste("select id_val from sample_numeric_data ",
           "where ia_id=''", arg1, "''", sep="")
 rs <- pg.spi.exec(sql)
 rng <- range(rs[,1])
 return(data.frame(mean = mean(rs[,1]),
  stddev = sd(rs[,1]), min = rng[1], max = rng[2],
  range = rng[2] - rng[1], count = length(rs[,1])))
' language 'plr';
PL/Java
/**
 * Update a modification time when the row is updated.
 */
static void moddatetime(TriggerData td)
throws SQLException
{
  if(td.isFiredForStatement())
    throw new TriggerException(td, "can't process STATEMENT events");

    if(td.isFiredAfter())
      throw new TriggerException(td, "must be fired before event");

    if(!td.isFiredByUpdate())
      throw new TriggerException(td, "can only process UPDATE events");

    ResultSet _new = td.getNew();
    String[] args = td.getArguments();
    if(args.length != 1)
      throw new TriggerException(td, "one argument was expected");

    _new.updateTimestamp(args[0], new Timestamp(System.currentTimeMillis()));
}
And Others ...
HAI
    CAN HAS DATABUKKIT?
    I HAS A RESULT
    I HAS A RECORD
    GIMMEH RESULT OUTTA DATABUKKIT "SELECT field
FROM mytable"
    IZ RESULT NOOB?
         YARLY
             BYES "SUMWUNZ IN YR PGSQL STEELIN YR
DATA"
    KTHX
    IM IN YR LOOP
         GIMMEH RECORD OUTTA RESULT
         VISIBLE RECORD!!FIELD
         IZ RESULT NOOB? KTHXBYE
    IM OUTTA YR LOOP
KTHXBYE
Hackability
●   Clean, easy to read code
●   Modular interfaces with clean separation of layers
●   #1 most hacked up database
    –   Yahoo, Greenplum, Paraccel, Netezza, Truviso ....
Performance


Better with simple queries and 2-core machines




   Better with complex queries and multi-core
                   machines
Benchmarks
      –   SpecJAppserver 2004, as of July 2007
            J2EE Througput                                   Acquisition Cost Comparison
900
                                                             200000
800                                                          180000

700                                                          160000




                                        Cost in US Dollars
600                                                          140000

500                                                          120000

                                                             100000
400
                                                             80000
300
                                                             60000
200
                                                             40000
100
                                                             20000
 0
                                                                  0
          MySQL   PostgreSQL   Oracle                                 MySQL   PostgreSQL   Oracle
Essential Performance
1)Every application performs best with the
  database for which is was designed.
2)Performance benchmarks for databases are
  constantly increasing.
3)Top databases are close enough that you can
  pick the one which suits you best.
Questions?
●   e-mail: josh@postgresql.org
●   IRC: irc.freenode.net, #postgresql
●   blog: blogs.ittoolbox.com/database/soup




                                               Special thanks to:
                                               Giuseppe Maxia and Harrison Fisk of MySQL for information
                                               about MySQL

              This talk is copyright 2008 Josh Berkus, and is licensed under the creative commons attribution license

Más contenido relacionado

La actualidad más candente

Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –
Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –
Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –虎の穴 開発室
 
MySQLerの7つ道具
MySQLerの7つ道具MySQLerの7つ道具
MySQLerの7つ道具yoku0825
 
Twitter의 snowflake 소개 및 활용
Twitter의 snowflake 소개 및 활용Twitter의 snowflake 소개 및 활용
Twitter의 snowflake 소개 및 활용흥배 최
 
Web3.0の話をしよう
Web3.0の話をしようWeb3.0の話をしよう
Web3.0の話をしようAtsushiSasaki9
 
Data Engineering 101
Data Engineering 101Data Engineering 101
Data Engineering 101DaeMyung Kang
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Mydbops
 
並列データベースシステムの概念と原理
並列データベースシステムの概念と原理並列データベースシステムの概念と原理
並列データベースシステムの概念と原理Makoto Yui
 
MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용I Goo Lee
 
[KAIST 채용설명회] 데이터 엔지니어는 무슨 일을 하나요?
[KAIST 채용설명회] 데이터 엔지니어는 무슨 일을 하나요?[KAIST 채용설명회] 데이터 엔지니어는 무슨 일을 하나요?
[KAIST 채용설명회] 데이터 엔지니어는 무슨 일을 하나요?Juhong Park
 
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)WON JOON YOO
 
Introduction VAUUM, Freezing, XID wraparound
Introduction VAUUM, Freezing, XID wraparoundIntroduction VAUUM, Freezing, XID wraparound
Introduction VAUUM, Freezing, XID wraparoundMasahiko Sawada
 
リレーショナルな正しいデータベース設計
リレーショナルな正しいデータベース設計リレーショナルな正しいデータベース設計
リレーショナルな正しいデータベース設計Mikiya Okuno
 
トランザクションの設計と進化
トランザクションの設計と進化トランザクションの設計と進化
トランザクションの設計と進化Kumazaki Hiroki
 
がっつりMongoDB事例紹介
がっつりMongoDB事例紹介がっつりMongoDB事例紹介
がっつりMongoDB事例紹介Tetsutaro Watanabe
 
Django ORM道場:クエリの基本を押さえ,より良い形を身に付けよう
Django ORM道場:クエリの基本を押さえ,より良い形を身に付けようDjango ORM道場:クエリの基本を押さえ,より良い形を身に付けよう
Django ORM道場:クエリの基本を押さえ,より良い形を身に付けようTakayuki Shimizukawa
 
雑なMySQLパフォーマンスチューニング
雑なMySQLパフォーマンスチューニング雑なMySQLパフォーマンスチューニング
雑なMySQLパフォーマンスチューニングyoku0825
 
MongoDB at Scale
MongoDB at ScaleMongoDB at Scale
MongoDB at ScaleMongoDB
 
binary log と 2PC と Group Commit
binary log と 2PC と Group Commitbinary log と 2PC と Group Commit
binary log と 2PC と Group CommitTakanori Sejima
 

La actualidad más candente (20)

Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –
Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –
Supabase Edge Functions と Netlify Edge Functions を使ってみる – 機能とその比較 –
 
MySQLerの7つ道具
MySQLerの7つ道具MySQLerの7つ道具
MySQLerの7つ道具
 
Twitter의 snowflake 소개 및 활용
Twitter의 snowflake 소개 및 활용Twitter의 snowflake 소개 및 활용
Twitter의 snowflake 소개 및 활용
 
Web3.0の話をしよう
Web3.0の話をしようWeb3.0の話をしよう
Web3.0の話をしよう
 
Data Engineering 101
Data Engineering 101Data Engineering 101
Data Engineering 101
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
 
並列データベースシステムの概念と原理
並列データベースシステムの概念と原理並列データベースシステムの概念と原理
並列データベースシステムの概念と原理
 
MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용
 
[KAIST 채용설명회] 데이터 엔지니어는 무슨 일을 하나요?
[KAIST 채용설명회] 데이터 엔지니어는 무슨 일을 하나요?[KAIST 채용설명회] 데이터 엔지니어는 무슨 일을 하나요?
[KAIST 채용설명회] 데이터 엔지니어는 무슨 일을 하나요?
 
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
딥 러닝 자연어 처리를 학습을 위한 파워포인트. (Deep Learning for Natural Language Processing)
 
Introduction VAUUM, Freezing, XID wraparound
Introduction VAUUM, Freezing, XID wraparoundIntroduction VAUUM, Freezing, XID wraparound
Introduction VAUUM, Freezing, XID wraparound
 
リレーショナルな正しいデータベース設計
リレーショナルな正しいデータベース設計リレーショナルな正しいデータベース設計
リレーショナルな正しいデータベース設計
 
トランザクションの設計と進化
トランザクションの設計と進化トランザクションの設計と進化
トランザクションの設計と進化
 
各種データベースの特徴とパフォーマンス比較
各種データベースの特徴とパフォーマンス比較各種データベースの特徴とパフォーマンス比較
各種データベースの特徴とパフォーマンス比較
 
がっつりMongoDB事例紹介
がっつりMongoDB事例紹介がっつりMongoDB事例紹介
がっつりMongoDB事例紹介
 
MongoDB Oplog入門
MongoDB Oplog入門MongoDB Oplog入門
MongoDB Oplog入門
 
Django ORM道場:クエリの基本を押さえ,より良い形を身に付けよう
Django ORM道場:クエリの基本を押さえ,より良い形を身に付けようDjango ORM道場:クエリの基本を押さえ,より良い形を身に付けよう
Django ORM道場:クエリの基本を押さえ,より良い形を身に付けよう
 
雑なMySQLパフォーマンスチューニング
雑なMySQLパフォーマンスチューニング雑なMySQLパフォーマンスチューニング
雑なMySQLパフォーマンスチューニング
 
MongoDB at Scale
MongoDB at ScaleMongoDB at Scale
MongoDB at Scale
 
binary log と 2PC と Group Commit
binary log と 2PC と Group Commitbinary log と 2PC と Group Commit
binary log と 2PC と Group Commit
 

Similar a PostgreSQL and MySQL

My sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlMy sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlsqlhjalp
 
MySQL Options in OpenStack
MySQL Options in OpenStackMySQL Options in OpenStack
MySQL Options in OpenStackTesora
 
OpenStack Days East -- MySQL Options in OpenStack
OpenStack Days East -- MySQL Options in OpenStackOpenStack Days East -- MySQL Options in OpenStack
OpenStack Days East -- MySQL Options in OpenStackMatt Lord
 
Rising Interest in Open Source Relational Databases
Rising Interest in Open Source Relational DatabasesRising Interest in Open Source Relational Databases
Rising Interest in Open Source Relational DatabasesChristopher Foot
 
My sql introduction for Bestcom
My sql introduction for BestcomMy sql introduction for Bestcom
My sql introduction for BestcomIvan Tu
 
My S Q L Introduction for 1 day training
My S Q L  Introduction for 1 day trainingMy S Q L  Introduction for 1 day training
My S Q L Introduction for 1 day trainingIvan Tu
 
Latest trends in database management
Latest trends in database managementLatest trends in database management
Latest trends in database managementBcomBT
 
The Real Scoop on Migrating from Oracle Databases
The Real Scoop on Migrating from Oracle DatabasesThe Real Scoop on Migrating from Oracle Databases
The Real Scoop on Migrating from Oracle DatabasesEDB
 
Upgrade to MySQL 8.0!
Upgrade to MySQL 8.0!Upgrade to MySQL 8.0!
Upgrade to MySQL 8.0!Ted Wennmark
 
01 upgrade to my sql8
01 upgrade to my sql8 01 upgrade to my sql8
01 upgrade to my sql8 Ted Wennmark
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...
Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...
Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...Lightbend
 
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!SolarWinds
 
Postgres for the Future
Postgres for the FuturePostgres for the Future
Postgres for the FutureEDB
 
Free Software and the Future of Database Technology
Free Software and the Future of Database TechnologyFree Software and the Future of Database Technology
Free Software and the Future of Database Technologyelliando dias
 
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA -   UKOUGEmbracing Database Diversity: The New Oracle / MySQL DBA -   UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUGKeith Hollman
 
Brk2051 sql server on linux and docker
Brk2051 sql server on linux and dockerBrk2051 sql server on linux and docker
Brk2051 sql server on linux and dockerBob Ward
 
Open Source Software – Open Day Oracle 2013
Open Source Software  – Open Day Oracle 2013Open Source Software  – Open Day Oracle 2013
Open Source Software – Open Day Oracle 2013Erik Gur
 

Similar a PostgreSQL and MySQL (20)

MySQL overview
MySQL overviewMySQL overview
MySQL overview
 
My sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlMy sql crashcourse_intro_kdl
My sql crashcourse_intro_kdl
 
MySQL Options in OpenStack
MySQL Options in OpenStackMySQL Options in OpenStack
MySQL Options in OpenStack
 
OpenStack Days East -- MySQL Options in OpenStack
OpenStack Days East -- MySQL Options in OpenStackOpenStack Days East -- MySQL Options in OpenStack
OpenStack Days East -- MySQL Options in OpenStack
 
Rising Interest in Open Source Relational Databases
Rising Interest in Open Source Relational DatabasesRising Interest in Open Source Relational Databases
Rising Interest in Open Source Relational Databases
 
My sql introduction for Bestcom
My sql introduction for BestcomMy sql introduction for Bestcom
My sql introduction for Bestcom
 
My S Q L Introduction for 1 day training
My S Q L  Introduction for 1 day trainingMy S Q L  Introduction for 1 day training
My S Q L Introduction for 1 day training
 
Maria DBMS
Maria DBMSMaria DBMS
Maria DBMS
 
Latest trends in database management
Latest trends in database managementLatest trends in database management
Latest trends in database management
 
The Real Scoop on Migrating from Oracle Databases
The Real Scoop on Migrating from Oracle DatabasesThe Real Scoop on Migrating from Oracle Databases
The Real Scoop on Migrating from Oracle Databases
 
Upgrade to MySQL 8.0!
Upgrade to MySQL 8.0!Upgrade to MySQL 8.0!
Upgrade to MySQL 8.0!
 
01 upgrade to my sql8
01 upgrade to my sql8 01 upgrade to my sql8
01 upgrade to my sql8
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...
Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...
Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere c...
 
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
 
Postgres for the Future
Postgres for the FuturePostgres for the Future
Postgres for the Future
 
Free Software and the Future of Database Technology
Free Software and the Future of Database TechnologyFree Software and the Future of Database Technology
Free Software and the Future of Database Technology
 
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA -   UKOUGEmbracing Database Diversity: The New Oracle / MySQL DBA -   UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
 
Brk2051 sql server on linux and docker
Brk2051 sql server on linux and dockerBrk2051 sql server on linux and docker
Brk2051 sql server on linux and docker
 
Open Source Software – Open Day Oracle 2013
Open Source Software  – Open Day Oracle 2013Open Source Software  – Open Day Oracle 2013
Open Source Software – Open Day Oracle 2013
 

Más de PostgreSQL Experts, Inc.

PostgreSQL Replication in 10 Minutes - SCALE
PostgreSQL Replication in 10  Minutes - SCALEPostgreSQL Replication in 10  Minutes - SCALE
PostgreSQL Replication in 10 Minutes - SCALEPostgreSQL Experts, Inc.
 
Elephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and VariantsElephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and VariantsPostgreSQL Experts, Inc.
 

Más de PostgreSQL Experts, Inc. (20)

Shootout at the PAAS Corral
Shootout at the PAAS CorralShootout at the PAAS Corral
Shootout at the PAAS Corral
 
Shootout at the AWS Corral
Shootout at the AWS CorralShootout at the AWS Corral
Shootout at the AWS Corral
 
Fail over fail_back
Fail over fail_backFail over fail_back
Fail over fail_back
 
PostgreSQL Replication in 10 Minutes - SCALE
PostgreSQL Replication in 10  Minutes - SCALEPostgreSQL Replication in 10  Minutes - SCALE
PostgreSQL Replication in 10 Minutes - SCALE
 
HowTo DR
HowTo DRHowTo DR
HowTo DR
 
Give A Great Tech Talk 2013
Give A Great Tech Talk 2013Give A Great Tech Talk 2013
Give A Great Tech Talk 2013
 
Pg py-and-squid-pypgday
Pg py-and-squid-pypgdayPg py-and-squid-pypgday
Pg py-and-squid-pypgday
 
92 grand prix_2013
92 grand prix_201392 grand prix_2013
92 grand prix_2013
 
Five steps perform_2013
Five steps perform_2013Five steps perform_2013
Five steps perform_2013
 
7 Ways To Crash Postgres
7 Ways To Crash Postgres7 Ways To Crash Postgres
7 Ways To Crash Postgres
 
PWNage: Producing a newsletter with Perl
PWNage: Producing a newsletter with PerlPWNage: Producing a newsletter with Perl
PWNage: Producing a newsletter with Perl
 
10 Ways to Destroy Your Community
10 Ways to Destroy Your Community10 Ways to Destroy Your Community
10 Ways to Destroy Your Community
 
Open Source Press Relations
Open Source Press RelationsOpen Source Press Relations
Open Source Press Relations
 
5 (more) Ways To Destroy Your Community
5 (more) Ways To Destroy Your Community5 (more) Ways To Destroy Your Community
5 (more) Ways To Destroy Your Community
 
Preventing Community (from Linux Collab)
Preventing Community (from Linux Collab)Preventing Community (from Linux Collab)
Preventing Community (from Linux Collab)
 
Development of 8.3 In India
Development of 8.3 In IndiaDevelopment of 8.3 In India
Development of 8.3 In India
 
50 Ways To Love Your Project
50 Ways To Love Your Project50 Ways To Love Your Project
50 Ways To Love Your Project
 
8.4 Upcoming Features
8.4 Upcoming Features 8.4 Upcoming Features
8.4 Upcoming Features
 
Elephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and VariantsElephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and Variants
 
Writeable CTEs: The Next Big Thing
Writeable CTEs: The Next Big ThingWriteable CTEs: The Next Big Thing
Writeable CTEs: The Next Big Thing
 

Último

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 

Último (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

PostgreSQL and MySQL

  • 1. Two great open source databases: a comparison Josh Berkus PostgreSQL Core Team HP Tux Talks, June 26, 2008
  • 2. Who is Josh? ● PostgreSQL Core Team – 10 years involvement with the project – Large database performance, tuning, project press & corporate relations, user groups ● Database geek – 15 years database application development – MS SQL, MySQL, Oracle, others ● Open Source guru – OpenOffice.org, LedgerSMB, Bricolage, OpenBRR, OSCON, more
  • 3. Topics ● Sound Bite ● History ● Most Common Uses ● Features ● Performance ● Summary
  • 4. Topics ● Sound Bite ● History QL t Most Common Uses eS ou ● gr ab ● Features st ly Po t Performance os ● m ● Summary
  • 5. Sound Bite "The most popular open source database" "The web database" "The world's most advanced open source database" "The open source Oracle"
  • 6. History of MySQL ● MySQL Server development started in 1994, marketed by TCX DataKonsult AB ● MySQL AB founded in 1995 by Michael “Monty” Widenius, David Axmark and Allan Larsson ● Server development based on requirements for practical production use: few features, but fast and stable ● Frequent releases with small changes ● Easy to install and use (15-minute rule)
  • 7. History of PostgreSQL • 1986: POSTGRES at the University of California, Berkeley > Michael Stonebraker project > Successor to INGRES • 1994: first commecialized > as Illustra (later merged into Informix) • 1995: open-sourced > Ported to SQL > PostgreSQL Global Development Group formed • 1997: ported to Japanese, supported in Japan • 1999: first full-time developers & corporate support • 2004: native Windows support • 2006: supported by Sun
  • 8. Development History Designed by/for Application Developers Designed by/for Database Administrators
  • 9. Development Priorities (historically) PostgreSQL MySQL 1.Data integrity 1.Ease-of-use 2.Security 2.Performance 3.Reliability 3.Programmer Features 4.Standards 4.Reliability 5.DB Features 5.DB Features 6.Performance 6.Data integrity 7.Ease-of-use 7.Security 8.Programmer Features 8.Standards
  • 10. Development Direction (a simplification) MySQL PostgreSQL Simple, Features, Easy to Use, Security, Fast Standards
  • 11. Community Owned by one company with user community Community-owned with many companies involved
  • 12. Core MySQL is 100% owned by Sun/MySQL ● 90% of MySQL developers work for Sun – except for the many storage engines ● MySQL has a large user community – many thousands active worldwide – many partners in other open source groups ● Sun/MySQL contributes to other OSS projects – PHP especially
  • 13. PostgreSQL has a large distributed developer and user community ● Not owned by any one company – dozens of companies and individuals contribute code – est. over 200 developers in 14 time zones ● "Community Owned" – supported by 5 different non-profits
  • 14. PostgreSQL Community Map Hackers Projects Committers User Groups and Co National Groups re Advocacy Companies Foundations
  • 15. Most Common Uses ● Web sites ● ERP ● CRM ● Data Warehouse ● Logging ● Geograpic ● OEM applications ● Web Sites ● Telecom (cluster) ● OEM applications ● Network tools ● Network tools ● Data Warehouse ● CRM
  • 16. Releases ● Feature-based releases ● Time-based releases – new features in minor – no new features in releases minor releases – every 1-3 years – every year ● 3.23: 2000 ● 7.4: 2003 ● 4.0: 2003 ● 8.0: 2004 ● 4.1: 2004 ● 8.1: 2005 ● 5.0: 2005 ● 8.2: 2006 ● 5.1: 2008? ● 8.3: 2008
  • 18. Storage Engines ● Pluggable "Storage Engines" allow MySQL to behave like a variety of different databases – Telecom DB: MySQL Cluster – Non-transactional: MyISAM – Transactional: InnoDB – Compressed: Archive – In-Memory: Memory – Write-only: Blackhole
  • 19. Programmer Features ● Excellent drivers for all languages – including JDBC4 ● PHP – high-performance drivers & special syntax – Native driver ● MySQL Proxy
  • 20. 3rd Party Support ● Most open source web projects default to MySQL – many use only MySQL – primary relational database for most top 25 web sites ● Hundreds of vendors support MySQL – more than 50% of multi-database products – many "MySQL Partners"
  • 21. MySQL Scale-Out ● Simple Replication makes it (relatively) simple to scale out – used by Google, Yahoo – load-balance reads on slaves – being supplanted by memcached Master Writes Reads Slave Requests Reads Load Balancer Slave
  • 22. Simplicity ● Easy to set up – "15 minute rule" – everything included ● Easy to administrate – programmer-administered – most installations don't need tuning ● Easy Replication – very simple master-slave & multimaster replication
  • 24. Migrateability ● Closest to proprietary enterprise DBs ● Automatic migration from Informix – Informix is 50% PostgreSQL ● Relatively easy migration from Oracle – easiest of any OSS database – puts migration cost within affordable range – tools for data integration ● SQL Server, DB2 harder – but easier that MySQL
  • 25. Security "... by default, PostgreSQL is the most security-aware database available ..." Database Hacker's Handbook (based on a comparison of PostgreSQL, MySQL, Oracle, DB2 and SQL Server)
  • 26. Security ● Authentication – multiple methods: login, SSL, Kerberos, more – host-based authentication ● Logging – log output is highly configurable and supports user auditing ● Permissions model – SQL ROLES supported, including nested roles – multiple settable permissions on all database objects
  • 27. Security ● Clean code – only one security patch per two months – community patches usually out in less 72 hours – only one exploit in the field in the last four years ● DB Auditing – PostgreSQL supports highly configurable triggers and other DB automation – No “auditing toolkit” out yet
  • 28. Transaction Support ● "Bulletproof" ACID thanks to MVCC – possibly best of any RDBMS ● Transactional DDL – apply schema changes in a transaction – great for change management ● including agile development ● Savepoints – spec-compliant "subtransactions"
  • 29. BI/DW Features ● Large database management features – tablespaces, table partitioning – automatic large field/row compression ● Powerful query planner & executor – complex queries with nested subselects, outer joins and calculated fields – large many-table joins with multiple join types ● Data mining features – full text indexing and regex support – embed external language DM modules
  • 30. BI/DW Features select a12.DAY_OF_WEEK_NBR AS DAY_OF_WEEK_NBR, max(TO_CHAR(a12.DATE_DESC ,'Day')) AS CustCol_6, a11.DATE_ID AS DATE_ID, max(a12.DATE_DESC) AS DATE_DESC, a11.FI_ID AS FI_ID, max(a13.FI_NAME) AS FI_NAME, a12.WEEK_YEAR_ID AS WEEK_YEAR_ID, max(a14.SHORT_WEEK_DESC) AS SHORT_WEEK_DESC, sum (session_count) AS WJXBFS1, sum ( a11_count ) AS WJXBFS2 from ( SELECT DATE_ID, FI_ID, count(distinct SESSION_ID) as session_count, COUNT(*) as a11_count FROM edata.WEB_SITE_ACTIVITY_FA WHERE DATE_ID in (2291, 2292, 2293, 2294, 2295) GROUP BY DATE_ID, FI_ID ) a11 join edata.DATE_LU a12 on (a11.DATE_ID = a12.DATE_ID) join edata.DIM_FI a13 on (a11.FI_ID = a13.FI_ID) join edata.WEEK_LU a14 on (a12.WEEK_YEAR_ID = a14.WEEK_YEAR_ID) group by a12.DAY_OF_WEEK_NBR, a11.DATE_ID, a11.FI_ID, a12.WEEK_YEAR_ID
  • 31. Extensibility ● Create your own database objects – almost any db object can be extended easily: ● functions ● types ● operators ● aggregates ● pseudo-tables – user-created objects are (usually) first class objects ● everything is a function – 12 different function languages
  • 32. Extensibility CREATE OR REPLACE FUNCTION _choose_random_text ( thestate _random_text, newvalue TEXT ) RETURNS _random_text AS $f$ DECLARE result _random_text; BEGIN result.runcount := COALESCE(thestate.runcount, 0) + 1; IF random() < ( 1::FLOAT / result.runcount::FLOAT ) THEN result.choice := newvalue; ELSE result.choice := thestate.choice; END IF; RETURN result; END; $f$ LANGUAGE plpgsql; CREATE AGGREGATE random_agg( BASETYPE = text, SFUNC = _choose_random_text, STYPE = _random_text, FINALFUNC = _exit_random_text );
  • 33. Special Data ● Base Types: ● Exotic types – char, varchar – geometric: polygon, line – large text – GIS (through PostGIS) – numeric – crypto – integers – ISN & ISBN – floats – XML – time, date, timestamp – network: INET, CIDR – bytea (for binary) – arrays – full text index – genome
  • 35. Special Data: genomics ● BLASTgres, Unison Protein Database
  • 36. Procedural Languages ● Use the language you prefer, inside the – database: – SQL – Java – PL/pgSQL – shell – C – R – C++ – PHP – Perl – Ruby – Python – Tcl ● In beta now: PSM, Lua
  • 37. PL/pgSQL create or replace function _set_self_paths ( ) returns trigger as $f$ declare parrec RECORD; has_kids BOOLEAN; begin --prevent setting order_by too high EXECUTE 'SELECT * FROM ' || TG_RELNAME || ' WHERE id = ' || CAST(NEW.parent as TEXT) INTO parrec; IF parrec.id is not null THEN NEW.path := parrec.path || (NEW.id::TEXT); NEW.order_path := parrec.order_path || to_char(NEW.order_by, 'FM0000'); NEW.show_path := parrec.show_path || ' / ' || NEW.name; ELSE NEW.path := text2ltree(NEW.id::TEXT); NEW.order_path := text2ltree(to_char(NEW.order_by, 'FM0000')); NEW.show_path := NEW.name; END IF; RETURN NEW; end; $f$ language plpgsql;
  • 38. PL/Perl CREATE FUNCTION "if_strip_numeric" (text,smallint) RETURNS text AS $f$ my($the_text, $cutoff) = @_; $the_text =~ s/[^0-9]/""/eg; if ( $cutoff > 0 ) { $the_text = ( substr $the_text, 0, $cutoff ); } return $the_text; $f$ LANGUAGE plperl IMMUTABLE, STRICT;
  • 39. PL/R create or replace function statsum(text) returns summarytup as ' sql<-paste("select id_val from sample_numeric_data ", "where ia_id=''", arg1, "''", sep="") rs <- pg.spi.exec(sql) rng <- range(rs[,1]) return(data.frame(mean = mean(rs[,1]), stddev = sd(rs[,1]), min = rng[1], max = rng[2], range = rng[2] - rng[1], count = length(rs[,1]))) ' language 'plr';
  • 40. PL/Java /** * Update a modification time when the row is updated. */ static void moddatetime(TriggerData td) throws SQLException { if(td.isFiredForStatement()) throw new TriggerException(td, "can't process STATEMENT events"); if(td.isFiredAfter()) throw new TriggerException(td, "must be fired before event"); if(!td.isFiredByUpdate()) throw new TriggerException(td, "can only process UPDATE events"); ResultSet _new = td.getNew(); String[] args = td.getArguments(); if(args.length != 1) throw new TriggerException(td, "one argument was expected"); _new.updateTimestamp(args[0], new Timestamp(System.currentTimeMillis())); }
  • 41. And Others ... HAI CAN HAS DATABUKKIT? I HAS A RESULT I HAS A RECORD GIMMEH RESULT OUTTA DATABUKKIT "SELECT field FROM mytable" IZ RESULT NOOB? YARLY BYES "SUMWUNZ IN YR PGSQL STEELIN YR DATA" KTHX IM IN YR LOOP GIMMEH RECORD OUTTA RESULT VISIBLE RECORD!!FIELD IZ RESULT NOOB? KTHXBYE IM OUTTA YR LOOP KTHXBYE
  • 42. Hackability ● Clean, easy to read code ● Modular interfaces with clean separation of layers ● #1 most hacked up database – Yahoo, Greenplum, Paraccel, Netezza, Truviso ....
  • 43. Performance Better with simple queries and 2-core machines Better with complex queries and multi-core machines
  • 44. Benchmarks – SpecJAppserver 2004, as of July 2007 J2EE Througput Acquisition Cost Comparison 900 200000 800 180000 700 160000 Cost in US Dollars 600 140000 500 120000 100000 400 80000 300 60000 200 40000 100 20000 0 0 MySQL PostgreSQL Oracle MySQL PostgreSQL Oracle
  • 45. Essential Performance 1)Every application performs best with the database for which is was designed. 2)Performance benchmarks for databases are constantly increasing. 3)Top databases are close enough that you can pick the one which suits you best.
  • 46. Questions? ● e-mail: josh@postgresql.org ● IRC: irc.freenode.net, #postgresql ● blog: blogs.ittoolbox.com/database/soup Special thanks to: Giuseppe Maxia and Harrison Fisk of MySQL for information about MySQL This talk is copyright 2008 Josh Berkus, and is licensed under the creative commons attribution license