SlideShare a Scribd company logo
1 of 21
Download to read offline
Lessons PostgreSQL learned from commercial
databases, and didn’t
Ilya Kosmodemiansky
ik@postgresql-consulting.com
Preamble
PostgreSQL is a great database!
• (You always need to say so if you are going to say PostgreSQL
lags behind commercial databases or has some limitations)
Preamble
PostgreSQL is a great database!
• The only open source database technology, massively used as
an alternative to commercial RDBMSs
• Moreover, 10 years ago it was seriously disputed (by some
people), if PostgreSQL can outperform MySQL
• Moreover, 5 years ago any Oracle to Postgres migration
case-study meant you will be 100% accepted to any
PostgreSQL conference
• Only PostgreSQL did such impressive progress!
• Well, Linux did, but Linux is not a database system
What made that possible?
• Good initial architecture
• Well organized community work
• SQL close to standard
• Procedural languages
• Lots of things - you probably know those things if you are here
Did PostgreSQL learne something?
(from commercial databases)
• Well, not directly
• At least, this a worst possible way to start discussion on
[HACKERS]: ”...we need this feature because Oracle has it...”
• Most likely people came from Oracle, did not find some
beloved instruments and started to implement a substitution
Anecdotally
• Prominent Soviet aircraft designer Tupolev, being unofficially
accused of plagiarizing some of his models, used to say that all
beautiful aircrafts look similar and that is why they can fly
• Tupolev’s ill-wishers believed that he definitely plagiarized that
formula as well - from some another aircraft designer...
• For aviation engineers, it was always obvious, that internally
airplanes were totally different
• Anyway, databases _are_ like aircrafts: common theory
beneath makes them look similar
That common theory was
Transactions
• If your data is important, use a database which supports ACID
transactions
• In PostgreSQL: MVCC implementation since version 6.5
(1999), WAL since 7.1 (2001)
• Adopting MVCC instead of pure-locking scheduler was wise
(DB2 and MS SQL Server proved that over the time)
• That allowed to implement reliable backup/recovery
mechanism and replication for high availability
• And that was actually a pivotal point, which started
PostgreSQL adoption in enterprise-level solutions
• Ironically, current MVCC implementation itself became some
limitation for Postgres
OK, hold on
What can actually stop you from choosing Postgres instead
of Oracle or DB2?
OK, hold on
What can actually stop you from choosing Postgres instead
of Oracle or DB2?
• Write performance - Yes, absolutely
• Database size - Yes, definitely
• Lack of diagnostics tools - Yes
• We need to run PostgreSQL in Microsoft environment - Yes
• Lack of qualified people - Maybe
• Lack of build in analog of RAC/PureScale - Yes and No
OK, hold on
What can actually stop you from choosing Postgres instead
of Oracle or DB2?
• Write performance - Yes, absolutely
• Database size - Yes, definitely
• Lack of diagnostics tools - Yes
• We need to run PostgreSQL in Microsoft environment - Yes
• Lack of qualified people - Maybe
• Lack of build in analog of RAC/PureScale - Yes and No
• We are talking about heavy workloads and comparing with
enterprise licenses
Main problem
Write performance
and
database size
PostgreSQL uses buffered writes
Disks
Kernel buffer
shared_buffers
Disks
Kernel buffer
shared_buffers
Buffered IO Direct IO
PostgreSQL uses buffered writes
• Effectively, one PostgreSQL process writes pages one by one to
kernel buffer, then that buffer will be flushed to disk
• Besides double-caching, this is slow and does not allow to use
some cool features (O_ATOMIC)
• Oracle can bypass kernel buffer using direct IO. Moreover,
both Oracle’s database writer and logwriter can swap threads
to write asynchronously
• That is a serious limitation for reaching high TPS figures on a
single instance
Huge database
• Same problem - double caching
• Storage overhead
• Backup performance and recovery time
• Autovacuum performance becomes an issue
Backup performance
• No build-in parallelism
• Level 0 plus PITR only
• Keeping undo information right in datafiles can be a problem
for incremental backups
Current MVCC implementation is a limitation itself
Nothing new, I only want to mention that it can be largest
challenge for PostgreSQL in the next 20 years
• It solves only one, the ”snapshot to old”, problem (and modern
Oracle solves it better)
• Undo information, spreaded inside datafiles brings a lot of
problems
Luck of diagnostics tools
• OK, there are plenty of them
• Tools, which require kernel developer experience, such as perf,
are not proper tools for a DBA
• Full time PostgreSQL developers are not DBAs. We need to
explain them, what we need and why
• Adding wait information to pg_stat_activity is a good
example of such joint effort
• And a good lesson learned from Oracle. Not the last I hope
PostgreSQL performance on Windows
• Well, there is no such thing. By the way, Oracle performs well
• At the same time, a lot of PostgreSQL on Windows
• Lack of enthusiasts for proper porting
• At the same time, we support various BSD and even Tru64
UNIX!
• Welcome to the world of open source!
Documetation
• Relatively small, but efficient, not over-engendered, covers all
topics well - at a first glance
• No graphic diagrams. It seems much easier to decide about
graphical format, than to rework MVCC!
• No guidebooks. Application developer must read a half of
documentation, to install Postgres in test environment!
• OK, there is PostgreSQL wiki, but it is not under release
control
In spite of all this
PostgreSQL is a great database!
• It is still relatively simple to start with and to live with
• It is safe. We have no listener, but we have no thick books
about securing listener from external attack.
• It learns fast
• May be it will change databases global market like Linux
change operating systems global market
Questions?
ik@postgresql-consulting.com

More Related Content

What's hot

What's hot (20)

PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
 
Is It Fast? : Measuring MongoDB Performance
Is It Fast? : Measuring MongoDB PerformanceIs It Fast? : Measuring MongoDB Performance
Is It Fast? : Measuring MongoDB Performance
 
On The Building Of A PostgreSQL Cluster
On The Building Of A PostgreSQL ClusterOn The Building Of A PostgreSQL Cluster
On The Building Of A PostgreSQL Cluster
 
Presto in my_use_case
Presto in my_use_casePresto in my_use_case
Presto in my_use_case
 
Postgrtesql as a NoSQL Document Store - The JSON/JSONB data type
Postgrtesql as a NoSQL Document Store - The JSON/JSONB data typePostgrtesql as a NoSQL Document Store - The JSON/JSONB data type
Postgrtesql as a NoSQL Document Store - The JSON/JSONB data type
 
Logical Replication in PostgreSQL - FLOSSUK 2016
Logical Replication in PostgreSQL - FLOSSUK 2016Logical Replication in PostgreSQL - FLOSSUK 2016
Logical Replication in PostgreSQL - FLOSSUK 2016
 
Big Data and PostgreSQL
Big Data and PostgreSQLBig Data and PostgreSQL
Big Data and PostgreSQL
 
Elephants in the Cloud
Elephants in the CloudElephants in the Cloud
Elephants in the Cloud
 
Go faster with_native_compilation Part-2
Go faster with_native_compilation Part-2Go faster with_native_compilation Part-2
Go faster with_native_compilation Part-2
 
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
 
10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL
 
Logical replication with pglogical
Logical replication with pglogicalLogical replication with pglogical
Logical replication with pglogical
 
Demystifying postgres logical replication percona live sc
Demystifying postgres logical replication percona live scDemystifying postgres logical replication percona live sc
Demystifying postgres logical replication percona live sc
 
TPC-H in MongoDB
TPC-H in MongoDBTPC-H in MongoDB
TPC-H in MongoDB
 
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
 
Compression talk
Compression talkCompression talk
Compression talk
 
Simple Works Best
 Simple Works Best Simple Works Best
Simple Works Best
 
Streaming huge databases using logical decoding
Streaming huge databases using logical decodingStreaming huge databases using logical decoding
Streaming huge databases using logical decoding
 
[EPPG] Oracle to PostgreSQL, Challenges to Opportunity
[EPPG] Oracle to PostgreSQL, Challenges to Opportunity[EPPG] Oracle to PostgreSQL, Challenges to Opportunity
[EPPG] Oracle to PostgreSQL, Challenges to Opportunity
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HA
 

Similar to Lessons PostgreSQL learned from commercial databases, and didn’t

NoSQL and CouchDB: the view from MOO
NoSQL and CouchDB: the view from MOONoSQL and CouchDB: the view from MOO
NoSQL and CouchDB: the view from MOO
James Hollingworth
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
Adi Challa
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive Writes
Liran Zelkha
 

Similar to Lessons PostgreSQL learned from commercial databases, and didn’t (20)

Store
StoreStore
Store
 
NoSQL and CouchDB: the view from MOO
NoSQL and CouchDB: the view from MOONoSQL and CouchDB: the view from MOO
NoSQL and CouchDB: the view from MOO
 
Drupal meets PostgreSQL for DrupalCamp MSK 2014
Drupal meets PostgreSQL for DrupalCamp MSK 2014Drupal meets PostgreSQL for DrupalCamp MSK 2014
Drupal meets PostgreSQL for DrupalCamp MSK 2014
 
Know thy cost (or where performance problems lurk)
Know thy cost (or where performance problems lurk)Know thy cost (or where performance problems lurk)
Know thy cost (or where performance problems lurk)
 
Keynote - Hosted PostgreSQL: An Objective Look
Keynote - Hosted PostgreSQL: An Objective LookKeynote - Hosted PostgreSQL: An Objective Look
Keynote - Hosted PostgreSQL: An Objective Look
 
Five Years of EC2 Distilled
Five Years of EC2 DistilledFive Years of EC2 Distilled
Five Years of EC2 Distilled
 
Oracle to Postgres Migration - part 1
Oracle to Postgres Migration - part 1Oracle to Postgres Migration - part 1
Oracle to Postgres Migration - part 1
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
 
Top 10 Application Problems
Top 10 Application ProblemsTop 10 Application Problems
Top 10 Application Problems
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL
 
Database Provisioning in EM12c: Provision me a Database Now!
Database Provisioning in EM12c: Provision me a Database Now!Database Provisioning in EM12c: Provision me a Database Now!
Database Provisioning in EM12c: Provision me a Database Now!
 
PostgreSQL as a Big Data Platform
PostgreSQL as a Big Data Platform PostgreSQL as a Big Data Platform
PostgreSQL as a Big Data Platform
 
Scaling a High Traffic Web Application: Our Journey from Java to PHP
Scaling a High Traffic Web Application: Our Journey from Java to PHPScaling a High Traffic Web Application: Our Journey from Java to PHP
Scaling a High Traffic Web Application: Our Journey from Java to PHP
 
Scaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web Applications
 
DrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilityDrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalability
 
Do you queue
Do you queueDo you queue
Do you queue
 
Scaling apps for the big time
Scaling apps for the big timeScaling apps for the big time
Scaling apps for the big time
 
Technical Introduction to PostgreSQL and PPAS
Technical Introduction to PostgreSQL and PPASTechnical Introduction to PostgreSQL and PPAS
Technical Introduction to PostgreSQL and PPAS
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive Writes
 
PostgreSQL as a Strategic Tool
PostgreSQL as a Strategic ToolPostgreSQL as a Strategic Tool
PostgreSQL as a Strategic Tool
 

More from PGConf APAC

More from PGConf APAC (20)

PGConf APAC 2018: Sponsored Talk by Fujitsu - The growing mandatory requireme...
PGConf APAC 2018: Sponsored Talk by Fujitsu - The growing mandatory requireme...PGConf APAC 2018: Sponsored Talk by Fujitsu - The growing mandatory requireme...
PGConf APAC 2018: Sponsored Talk by Fujitsu - The growing mandatory requireme...
 
PGConf APAC 2018: PostgreSQL 10 - Replication goes Logical
PGConf APAC 2018: PostgreSQL 10 - Replication goes LogicalPGConf APAC 2018: PostgreSQL 10 - Replication goes Logical
PGConf APAC 2018: PostgreSQL 10 - Replication goes Logical
 
PGConf APAC 2018 - Lightening Talk #3: How To Contribute to PostgreSQL
PGConf APAC 2018 - Lightening Talk #3: How To Contribute to PostgreSQLPGConf APAC 2018 - Lightening Talk #3: How To Contribute to PostgreSQL
PGConf APAC 2018 - Lightening Talk #3: How To Contribute to PostgreSQL
 
PGConf APAC 2018 - Lightening Talk #2 - Centralizing Authorization in PostgreSQL
PGConf APAC 2018 - Lightening Talk #2 - Centralizing Authorization in PostgreSQLPGConf APAC 2018 - Lightening Talk #2 - Centralizing Authorization in PostgreSQL
PGConf APAC 2018 - Lightening Talk #2 - Centralizing Authorization in PostgreSQL
 
Sponsored Talk @ PGConf APAC 2018 - Choosing the right partner in your Postgr...
Sponsored Talk @ PGConf APAC 2018 - Choosing the right partner in your Postgr...Sponsored Talk @ PGConf APAC 2018 - Choosing the right partner in your Postgr...
Sponsored Talk @ PGConf APAC 2018 - Choosing the right partner in your Postgr...
 
PGConf APAC 2018 - A PostgreSQL DBAs Toolbelt for 2018
PGConf APAC 2018 - A PostgreSQL DBAs Toolbelt for 2018PGConf APAC 2018 - A PostgreSQL DBAs Toolbelt for 2018
PGConf APAC 2018 - A PostgreSQL DBAs Toolbelt for 2018
 
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companionPGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
 
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json  postgre-sql vs. mongodbPGConf APAC 2018 - High performance json  postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
 
PGConf APAC 2018 - Monitoring PostgreSQL at Scale
PGConf APAC 2018 - Monitoring PostgreSQL at ScalePGConf APAC 2018 - Monitoring PostgreSQL at Scale
PGConf APAC 2018 - Monitoring PostgreSQL at Scale
 
PGConf APAC 2018 - Where's Waldo - Text Search and Pattern in PostgreSQL
PGConf APAC 2018 - Where's Waldo - Text Search and Pattern in PostgreSQLPGConf APAC 2018 - Where's Waldo - Text Search and Pattern in PostgreSQL
PGConf APAC 2018 - Where's Waldo - Text Search and Pattern in PostgreSQL
 
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
 
PGConf APAC 2018 - PostgreSQL HA with Pgpool-II and whats been happening in P...
PGConf APAC 2018 - PostgreSQL HA with Pgpool-II and whats been happening in P...PGConf APAC 2018 - PostgreSQL HA with Pgpool-II and whats been happening in P...
PGConf APAC 2018 - PostgreSQL HA with Pgpool-II and whats been happening in P...
 
PGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PGConf APAC 2018 - PostgreSQL performance comparison in various cloudsPGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PGConf APAC 2018 - PostgreSQL performance comparison in various clouds
 
Sponsored Talk @ PGConf APAC 2018 - Migrating Oracle to EDB Postgres Approach...
Sponsored Talk @ PGConf APAC 2018 - Migrating Oracle to EDB Postgres Approach...Sponsored Talk @ PGConf APAC 2018 - Migrating Oracle to EDB Postgres Approach...
Sponsored Talk @ PGConf APAC 2018 - Migrating Oracle to EDB Postgres Approach...
 
PGConf APAC 2018 - Tale from Trenches
PGConf APAC 2018 - Tale from TrenchesPGConf APAC 2018 - Tale from Trenches
PGConf APAC 2018 - Tale from Trenches
 
PGConf APAC 2018 Keynote: PostgreSQL goes eleven
PGConf APAC 2018 Keynote: PostgreSQL goes elevenPGConf APAC 2018 Keynote: PostgreSQL goes eleven
PGConf APAC 2018 Keynote: PostgreSQL goes eleven
 
Amazon (AWS) Aurora
Amazon (AWS) AuroraAmazon (AWS) Aurora
Amazon (AWS) Aurora
 
Use Case: PostGIS and Agribotics
Use Case: PostGIS and AgriboticsUse Case: PostGIS and Agribotics
Use Case: PostGIS and Agribotics
 
How to teach an elephant to rock'n'roll
How to teach an elephant to rock'n'rollHow to teach an elephant to rock'n'roll
How to teach an elephant to rock'n'roll
 
PostgreSQL on Amazon RDS
PostgreSQL on Amazon RDSPostgreSQL on Amazon RDS
PostgreSQL on Amazon RDS
 

Recently uploaded

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Recently uploaded (20)

%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 

Lessons PostgreSQL learned from commercial databases, and didn’t

  • 1. Lessons PostgreSQL learned from commercial databases, and didn’t Ilya Kosmodemiansky ik@postgresql-consulting.com
  • 2. Preamble PostgreSQL is a great database! • (You always need to say so if you are going to say PostgreSQL lags behind commercial databases or has some limitations)
  • 3. Preamble PostgreSQL is a great database! • The only open source database technology, massively used as an alternative to commercial RDBMSs • Moreover, 10 years ago it was seriously disputed (by some people), if PostgreSQL can outperform MySQL • Moreover, 5 years ago any Oracle to Postgres migration case-study meant you will be 100% accepted to any PostgreSQL conference • Only PostgreSQL did such impressive progress! • Well, Linux did, but Linux is not a database system
  • 4. What made that possible? • Good initial architecture • Well organized community work • SQL close to standard • Procedural languages • Lots of things - you probably know those things if you are here
  • 5. Did PostgreSQL learne something? (from commercial databases) • Well, not directly • At least, this a worst possible way to start discussion on [HACKERS]: ”...we need this feature because Oracle has it...” • Most likely people came from Oracle, did not find some beloved instruments and started to implement a substitution
  • 6. Anecdotally • Prominent Soviet aircraft designer Tupolev, being unofficially accused of plagiarizing some of his models, used to say that all beautiful aircrafts look similar and that is why they can fly • Tupolev’s ill-wishers believed that he definitely plagiarized that formula as well - from some another aircraft designer... • For aviation engineers, it was always obvious, that internally airplanes were totally different • Anyway, databases _are_ like aircrafts: common theory beneath makes them look similar
  • 7. That common theory was Transactions • If your data is important, use a database which supports ACID transactions • In PostgreSQL: MVCC implementation since version 6.5 (1999), WAL since 7.1 (2001) • Adopting MVCC instead of pure-locking scheduler was wise (DB2 and MS SQL Server proved that over the time) • That allowed to implement reliable backup/recovery mechanism and replication for high availability • And that was actually a pivotal point, which started PostgreSQL adoption in enterprise-level solutions • Ironically, current MVCC implementation itself became some limitation for Postgres
  • 8. OK, hold on What can actually stop you from choosing Postgres instead of Oracle or DB2?
  • 9. OK, hold on What can actually stop you from choosing Postgres instead of Oracle or DB2? • Write performance - Yes, absolutely • Database size - Yes, definitely • Lack of diagnostics tools - Yes • We need to run PostgreSQL in Microsoft environment - Yes • Lack of qualified people - Maybe • Lack of build in analog of RAC/PureScale - Yes and No
  • 10. OK, hold on What can actually stop you from choosing Postgres instead of Oracle or DB2? • Write performance - Yes, absolutely • Database size - Yes, definitely • Lack of diagnostics tools - Yes • We need to run PostgreSQL in Microsoft environment - Yes • Lack of qualified people - Maybe • Lack of build in analog of RAC/PureScale - Yes and No • We are talking about heavy workloads and comparing with enterprise licenses
  • 12. PostgreSQL uses buffered writes Disks Kernel buffer shared_buffers Disks Kernel buffer shared_buffers Buffered IO Direct IO
  • 13. PostgreSQL uses buffered writes • Effectively, one PostgreSQL process writes pages one by one to kernel buffer, then that buffer will be flushed to disk • Besides double-caching, this is slow and does not allow to use some cool features (O_ATOMIC) • Oracle can bypass kernel buffer using direct IO. Moreover, both Oracle’s database writer and logwriter can swap threads to write asynchronously • That is a serious limitation for reaching high TPS figures on a single instance
  • 14. Huge database • Same problem - double caching • Storage overhead • Backup performance and recovery time • Autovacuum performance becomes an issue
  • 15. Backup performance • No build-in parallelism • Level 0 plus PITR only • Keeping undo information right in datafiles can be a problem for incremental backups
  • 16. Current MVCC implementation is a limitation itself Nothing new, I only want to mention that it can be largest challenge for PostgreSQL in the next 20 years • It solves only one, the ”snapshot to old”, problem (and modern Oracle solves it better) • Undo information, spreaded inside datafiles brings a lot of problems
  • 17. Luck of diagnostics tools • OK, there are plenty of them • Tools, which require kernel developer experience, such as perf, are not proper tools for a DBA • Full time PostgreSQL developers are not DBAs. We need to explain them, what we need and why • Adding wait information to pg_stat_activity is a good example of such joint effort • And a good lesson learned from Oracle. Not the last I hope
  • 18. PostgreSQL performance on Windows • Well, there is no such thing. By the way, Oracle performs well • At the same time, a lot of PostgreSQL on Windows • Lack of enthusiasts for proper porting • At the same time, we support various BSD and even Tru64 UNIX! • Welcome to the world of open source!
  • 19. Documetation • Relatively small, but efficient, not over-engendered, covers all topics well - at a first glance • No graphic diagrams. It seems much easier to decide about graphical format, than to rework MVCC! • No guidebooks. Application developer must read a half of documentation, to install Postgres in test environment! • OK, there is PostgreSQL wiki, but it is not under release control
  • 20. In spite of all this PostgreSQL is a great database! • It is still relatively simple to start with and to live with • It is safe. We have no listener, but we have no thick books about securing listener from external attack. • It learns fast • May be it will change databases global market like Linux change operating systems global market