SlideShare a Scribd company logo
<Insert Picture Here>
PHP and MySQL – The Current State
Johannes Schlüter
MySQL Engineering: Connectors & Client Connectivity
The following is intended to outline our general
product direction. It is intended for information
purposes only, and may not be incorporated into any
contract. It is not a commitment to deliver any
material, code, or functionality, and should not be
relied upon in making purchasing decisions.
The development, release, and timing of any
features or functionality described for Oracle’s
products remains at the sole discretion of Oracle.
Oracle’s Strategy:
Complete. Open. Integrated.
• Built together
• Tested together
• Managed together
• Serviced together
• Based on open standards
• Lower cost
• Lower risk
• More reliable
Oracle’s Investment in Open Source
• Supported popular open source projects for many years
• Part of Oracle’s Complete, Open, Integrated strategy
• Speed up time-to-innovation
• Expand the developer community
• Oracle never settles for being
second best at any level of the
stack
• “Complete” means we meet
most customer requirements
at every level
That’s why MySQL matters
to Oracle and Oracle
customers
Industry’s Most Complete LAMP Stack
–Oracle Enterprise Linux
–Oracle VM (Xen-based)
–Apache
–MySQL
–PHP, Perl, Python
MySQL
Apache
Eclipse
NetBeans
Apps
PHP
Investment in MySQL
• Make MySQL a Better MySQL
– #1 Open Source Database for Web Applications
• Develop, Promote and Support MySQL
– Improve engineering, consulting and support
– Leverage 24x7, World-Class Oracle Support
• MySQL Community Edition
– Source and binary releases
– GPL license
Investment in MySQL
• MySQL Focus Areas
– Web, Embedded & Telecom
– LAMP
– Windows
• Oracle + MySQL Customers
– Oracle Enterprise Manager
– Oracle Secure Backup
– Oracle Audit Vault
InnoDB will become default
• ACID Transactions, FKs, Crash Recovery
Improved Availability
• Semi-synchronous Replication
• Replication Heartbeat
Improved Usability
• SIGNAL/RESIGNAL
• More Partitioning Options
• PERFORMANCE_SCHEMA
Better Instrumentation/Diagnostics
• InnoDB stats in 5.5 PERFORMANCE_SCHEMA
MySQL 5.5
RC
InnoDB Performance improvements
• Multiple Buffer Pool Instances
• Multiple Rollback Segments
• Extended Change Buffering (with delete buffering, purge buffering)
• Improved Purge Scheduling
• Improved Log Sys mutex
• Separate Flush List mutex
MySQL Performance Improvements
• Better Metadata Locking within Transactions
• Split LOCK_open mutex
• Eliminated LOCK_alarm mutex as bottleneck
• Eliminated LOCK_thread_count as bottleneck
• Improved Performance/Scale on Win32, 64
More than 10x improvement in recovery times
MySQL 5.5 is Faster!
RC
MySQL 5.5 SysBench Benchmarks
Linux
Intel Xeon X7460 x86_64
4 CPU x 6 Cores/CPU
2.66 GHz, 32GB RAM
Fedora 10
MySQL 5.1.50
(InnoDB built-in)
MySQL 5.1.50
(InnoDB Plug-in)
MySQL 5.5.6
(New InnoDB)
200% performance gain
for MySQL 5.5 over 5.1.50; at scale
RC
MySQL 5.5 SysBench Benchmarks
Linux
MySQL 5.1.50
(InnoDB built-in)
MySQL 5.1.50
(InnoDB Plug-in)
MySQL 5.5.6
(New InnoDB)
Intel Xeon X7460 x86_64
4 CPU x 6 Cores/CPU
2.66 GHz, 32GB RAM
Fedora 10
369% performance gain
for MySQL 5.5 over 5.1.50; at scale
RC
PHP Extensions for MySQL
PDO_mysql
ext/mysql mysqli
PHP
ext/mysql
• One of the first PHP extensions
• Actively maintained with PHP 4
– No new features in PHP 5
• Exception: Added mysqlnd support with PHP 5.3
– Bug fixing only
• Best documented database extension
– Tons of books, tutorials, …
• Missing support for many MySQL features
– Prepared statements, Queries with multiple result sets (stored
procedures), compression, encryption, full charset support, …
PDO_mysql
• “The PHP Data Objects (PDO) extension defines a
lightweight, consistent interface for accessing
databases in PHP.” http://php.net/intro.pdo
• Lowest common denominator
• PHPish API
• Broken by Design™
$ php --rf PDO::sqliteCreateFunction
Exception: Method PDO::sqliteCreateFunction() does not exist
PDO – Broken by Design
Intermezzo: Prepared Statements
Client Server
SELECT foo
FROM bar
WHERE id = 42
•Create Execution plan
•Query database
Resultset(s)
query()
Intermezzo: Prepared Statements
Client Server
SELECT foo
FROM bar
WHERE id = ?
•Query database
Resultset(s)
Handle
Handle
Param 1: 42
•Create Execution plan
prepare()
execute()
PDO – Broken by Design
<?php
$pdo = new PDO(“mysql:host=localhost;dbname=test”,
“user”, “password”);
$query = $pdo->prepare(
“SELECT id FROM table LIMT ?, ?”);
$query->bindValue(1, $_GET[“offset”]);
$query->bindValue(2, $_GET[“limit”]);
$query->execute();
“The mysqli extension, or as it is sometimes known,
the MySQL improved extension, was developed to
take advantage of new features found in MySQL
systems versions 4.1.3 and newer. […] If you are
using MySQL versions 4.1.3 or later it is strongly
recommended that you use this extension.”
http://php.net/mysqli.overview
What The PHP Manual Is Saying
Extended(!) support for
MySQL 4.0(!) ended 2008-09-30
mysqli
The Improved MySQL Extension
• Full support for all MySQL features
– Stored Procedures
– Prepared Statements
– Encryption (SSL)
– Compression
– Charsets
– …
• Actively developed, maintained and supported by
Oracle
PHP and mysqlnd
PHP
PHP Memory IO: PHP StreamsInfrastructure
ext/mysql PDO_mysqlmysqli
mysqlnd – MySQL native driver for PHP
MySQL Server
libmysql vs. mysqlnd
MySQL Server MySQL Server
mysqlnd libmysql
PHP PHP
PHP Memory
libmysql Memory
PHP Memory
PHP Memory
copy
copy
usedirectly
copy
Building PHP with mysqlnd
• ./configure 
--with-mysql=mysqlnd 
--with-mysqli=msqlnd 
--with-pdo-mysql=mysqlnd
• Default on Windows and some distributions
mysqlnd Statistics
• Around 150 statistic values collected
• mysqli_get_client_stats (),
mysqli_get_connection_stats()
Asynchronous Queries
/* Do something */
PHP Script MySQL
query
result
query
poll
result
$conn = new MySQLi(...);
$conn->query(
"SELECT * FROM t WHERE ....",
MYSQLI_ASYNC);
/* Process query results */
mysqli_poll($links, $errors, $reject, 1);
Sharding
<?php
…
?>
Sharding
foreach ($all_links as $link)
$link->query("SELECT 'test' ", MYSQLI_ASYNC);
$processed = 0;
do {
$links = $all_links;
if (!mysqli_poll($links, $errors, $reject, 1)) continue; /* TIMEOUT */
foreach ($links as $link) {
if ($result = $link->reap_async_query()) {
print_r($result->fetch_row());
mysqli_free_result($result);
$processed++;
}
}
} while ($processed < count($all_links));
mysqlnd plugins
Plugin Hook
mysqlnd Query
mysqli::query()mysql_query() PDO::query()
Wire Protocol
Plugin Hook
Network
mysqlnd Plugins
• “mysqlnd client proxy”
– Load Balancing
• Read / Write splitting
• Failover
– Monitoring
• Query Logging
• Query Auditing
– Performance
• Caching
• Sharding
The Database Is The Bottleneck
Caching!
# pecl install mysqlnd_qc-beta
… and you are done!
Almost at least ;-)
mysqlnd Query cache
• For more:
• Ulf's presentation → Tomorrow 16:30 (German)
Experimental Extensions
• By Oracle:
– mysqlnd_sip
– mysqlnd_mc
– mysqlnd_ms
– mysqlnd_pscache
• By Community:
– mysqlnd_uh
(David Soria Parra /
Mayflower GmbH)
mysqlnd_uh
class ConnProxy extends MysqlndUHConnection {
public function query($conn, $query) {
if ($query == “SELECT 1”) {
$query = “SELECT 2”;
}
return parent::query($conn, $query);
}
}
mysqlnd_uh_set_connection_proxy(new ConnProxy());
Key Takeaways
• MySQL is important to Oracle and our customers
– Part of our Complete, Open, Integrated strategy
• Oracle is making MySQL better today
– Major Feature, Performance, Scalability enhancements
– 24x7, Global support in 145 countries
Download Now
http://dev.mysql.com/downloads
Download Now
http://dev.mysql.com/downloads
Ipc mysql php
Ipc mysql php
Ipc mysql php

More Related Content

What's hot

My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2
Morgan Tocker
 
MySQL 5.7: Core Server Changes
MySQL 5.7: Core Server ChangesMySQL 5.7: Core Server Changes
MySQL 5.7: Core Server Changes
Morgan Tocker
 

What's hot (20)

MySQL 5.7 + JSON
MySQL 5.7 + JSONMySQL 5.7 + JSON
MySQL 5.7 + JSON
 
IaC MeetUp Active Directory Setup for Oracle Security LAB
IaC MeetUp Active Directory Setup for Oracle Security LABIaC MeetUp Active Directory Setup for Oracle Security LAB
IaC MeetUp Active Directory Setup for Oracle Security LAB
 
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
 
My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2
 
MySQL NoSQL APIs
MySQL NoSQL APIsMySQL NoSQL APIs
MySQL NoSQL APIs
 
Top 15 MySQL parameters
Top 15 MySQL parameters Top 15 MySQL parameters
Top 15 MySQL parameters
 
Awr doag
Awr doagAwr doag
Awr doag
 
Middleware upgrade to Oracle Fusion Middleware(FMW) 12c.Real Case stories.
Middleware upgrade to Oracle Fusion Middleware(FMW) 12c.Real Case stories. Middleware upgrade to Oracle Fusion Middleware(FMW) 12c.Real Case stories.
Middleware upgrade to Oracle Fusion Middleware(FMW) 12c.Real Case stories.
 
REST in Piece - Administration of an Oracle Cluster/Database using REST
REST in Piece - Administration of an Oracle Cluster/Database using RESTREST in Piece - Administration of an Oracle Cluster/Database using REST
REST in Piece - Administration of an Oracle Cluster/Database using REST
 
AUSOUG Oracle Password Security
AUSOUG Oracle Password SecurityAUSOUG Oracle Password Security
AUSOUG Oracle Password Security
 
MySQL 5.7: Core Server Changes
MySQL 5.7: Core Server ChangesMySQL 5.7: Core Server Changes
MySQL 5.7: Core Server Changes
 
Security Best Practice: Oracle passwords, but secure!
Security Best Practice: Oracle passwords, but secure!Security Best Practice: Oracle passwords, but secure!
Security Best Practice: Oracle passwords, but secure!
 
MythBusters Globalization Support - Avoid Data Corruption
MythBusters Globalization Support - Avoid Data CorruptionMythBusters Globalization Support - Avoid Data Corruption
MythBusters Globalization Support - Avoid Data Corruption
 
Lamp Introduction 20100419
Lamp Introduction 20100419Lamp Introduction 20100419
Lamp Introduction 20100419
 
Oracle Cloud deployment with Terraform
Oracle Cloud deployment with TerraformOracle Cloud deployment with Terraform
Oracle Cloud deployment with Terraform
 
WebLogic on ODA - Oracle Open World 2013
WebLogic on ODA - Oracle Open World 2013WebLogic on ODA - Oracle Open World 2013
WebLogic on ODA - Oracle Open World 2013
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7
 
MySQL Webinar 2/4 Performance tuning, hardware, optimisation
MySQL Webinar 2/4 Performance tuning, hardware, optimisationMySQL Webinar 2/4 Performance tuning, hardware, optimisation
MySQL Webinar 2/4 Performance tuning, hardware, optimisation
 
Avoid boring work_v2
Avoid boring work_v2Avoid boring work_v2
Avoid boring work_v2
 
Proxysql use case scenarios fosdem17
Proxysql use case scenarios    fosdem17Proxysql use case scenarios    fosdem17
Proxysql use case scenarios fosdem17
 

Viewers also liked (8)

ABC
ABCABC
ABC
 
Rolando aza
Rolando azaRolando aza
Rolando aza
 
GNI- purchasing power parity
GNI- purchasing power parityGNI- purchasing power parity
GNI- purchasing power parity
 
Climas 2 Elaios
Climas 2 ElaiosClimas 2 Elaios
Climas 2 Elaios
 
Fotostrasse Mediakit December 2014
Fotostrasse Mediakit December 2014Fotostrasse Mediakit December 2014
Fotostrasse Mediakit December 2014
 
Tienes 5 segundos
Tienes 5 segundosTienes 5 segundos
Tienes 5 segundos
 
Post tranlational modification
Post tranlational modificationPost tranlational modification
Post tranlational modification
 
Arte paleolítico
Arte paleolíticoArte paleolítico
Arte paleolítico
 

Similar to Ipc mysql php

PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopers
Bryan Cafferky
 
My sqlstrategyroadmap
My sqlstrategyroadmapMy sqlstrategyroadmap
My sqlstrategyroadmap
slidethanks
 

Similar to Ipc mysql php (20)

MySQL Document Store
MySQL Document StoreMySQL Document Store
MySQL Document Store
 
PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopers
 
Top ten-list
Top ten-listTop ten-list
Top ten-list
 
MySQL Strategy&Roadmap
MySQL Strategy&RoadmapMySQL Strategy&Roadmap
MySQL Strategy&Roadmap
 
My sqlstrategyroadmap
My sqlstrategyroadmapMy sqlstrategyroadmap
My sqlstrategyroadmap
 
Plantilla oracle
Plantilla oraclePlantilla oracle
Plantilla oracle
 
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
 
VMworld 2013: Virtualizing Databases: Doing IT Right
VMworld 2013: Virtualizing Databases: Doing IT Right VMworld 2013: Virtualizing Databases: Doing IT Right
VMworld 2013: Virtualizing Databases: Doing IT Right
 
MySQL PHP native driver : Advanced Functions / PHP forum Paris 2013
 MySQL PHP native driver  : Advanced Functions / PHP forum Paris 2013   MySQL PHP native driver  : Advanced Functions / PHP forum Paris 2013
MySQL PHP native driver : Advanced Functions / PHP forum Paris 2013
 
Northeast PHP - High Performance PHP
Northeast PHP - High Performance PHPNortheast PHP - High Performance PHP
Northeast PHP - High Performance PHP
 
Experience sql server on l inux and docker
Experience sql server on l inux and dockerExperience sql server on l inux and docker
Experience sql server on l inux and docker
 
Introdução ao Oracle NoSQL
Introdução ao Oracle NoSQLIntrodução ao Oracle NoSQL
Introdução ao Oracle NoSQL
 
Rajnish singh(presentation on oracle )
Rajnish singh(presentation on  oracle )Rajnish singh(presentation on  oracle )
Rajnish singh(presentation on oracle )
 
Standardizing and Managing Your Infrastructure - MOSC 2011
Standardizing and Managing Your Infrastructure - MOSC 2011Standardizing and Managing Your Infrastructure - MOSC 2011
Standardizing and Managing Your Infrastructure - MOSC 2011
 
제3회난공불락 오픈소스 인프라세미나 - MySQL
제3회난공불락 오픈소스 인프라세미나 - MySQL제3회난공불락 오픈소스 인프라세미나 - MySQL
제3회난공불락 오픈소스 인프라세미나 - MySQL
 
Php &amp; my sql - how do pdo, mysq-li, and x devapi do what they do
Php &amp; my sql  - how do pdo, mysq-li, and x devapi do what they doPhp &amp; my sql  - how do pdo, mysq-li, and x devapi do what they do
Php &amp; my sql - how do pdo, mysq-li, and x devapi do what they do
 
ow.ppt
ow.pptow.ppt
ow.ppt
 
ow.ppt
ow.pptow.ppt
ow.ppt
 
Ow
OwOw
Ow
 
ITB2017 - Keynote
ITB2017 - KeynoteITB2017 - Keynote
ITB2017 - Keynote
 

More from Anis Berejeb

Advanced Date/Time Handling with PHP
Advanced Date/Time Handling with PHPAdvanced Date/Time Handling with PHP
Advanced Date/Time Handling with PHP
Anis Berejeb
 
APC & Memcache the High Performance Duo
APC & Memcache the High Performance DuoAPC & Memcache the High Performance Duo
APC & Memcache the High Performance Duo
Anis Berejeb
 
Mysqlnd Query Cache
Mysqlnd Query CacheMysqlnd Query Cache
Mysqlnd Query Cache
Anis Berejeb
 
Barcelona mysqlnd qc
Barcelona mysqlnd qcBarcelona mysqlnd qc
Barcelona mysqlnd qc
Anis Berejeb
 
Barcelona 2010 hidden_features
Barcelona 2010 hidden_featuresBarcelona 2010 hidden_features
Barcelona 2010 hidden_features
Anis Berejeb
 

More from Anis Berejeb (9)

Perf tuning2
Perf tuning2Perf tuning2
Perf tuning2
 
Explain2
Explain2Explain2
Explain2
 
Advanced Date/Time Handling with PHP
Advanced Date/Time Handling with PHPAdvanced Date/Time Handling with PHP
Advanced Date/Time Handling with PHP
 
APC & Memcache the High Performance Duo
APC & Memcache the High Performance DuoAPC & Memcache the High Performance Duo
APC & Memcache the High Performance Duo
 
Mysqlnd Query Cache
Mysqlnd Query CacheMysqlnd Query Cache
Mysqlnd Query Cache
 
Barcelona mysqlnd qc
Barcelona mysqlnd qcBarcelona mysqlnd qc
Barcelona mysqlnd qc
 
Mysql tracing
Mysql tracingMysql tracing
Mysql tracing
 
Mysql tracing
Mysql tracingMysql tracing
Mysql tracing
 
Barcelona 2010 hidden_features
Barcelona 2010 hidden_featuresBarcelona 2010 hidden_features
Barcelona 2010 hidden_features
 

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 

Ipc mysql php

  • 1.
  • 2. <Insert Picture Here> PHP and MySQL – The Current State Johannes Schlüter MySQL Engineering: Connectors & Client Connectivity
  • 3. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 4. Oracle’s Strategy: Complete. Open. Integrated. • Built together • Tested together • Managed together • Serviced together • Based on open standards • Lower cost • Lower risk • More reliable
  • 5. Oracle’s Investment in Open Source • Supported popular open source projects for many years • Part of Oracle’s Complete, Open, Integrated strategy • Speed up time-to-innovation • Expand the developer community
  • 6. • Oracle never settles for being second best at any level of the stack • “Complete” means we meet most customer requirements at every level That’s why MySQL matters to Oracle and Oracle customers
  • 7. Industry’s Most Complete LAMP Stack –Oracle Enterprise Linux –Oracle VM (Xen-based) –Apache –MySQL –PHP, Perl, Python MySQL Apache Eclipse NetBeans Apps PHP
  • 8. Investment in MySQL • Make MySQL a Better MySQL – #1 Open Source Database for Web Applications • Develop, Promote and Support MySQL – Improve engineering, consulting and support – Leverage 24x7, World-Class Oracle Support • MySQL Community Edition – Source and binary releases – GPL license
  • 9. Investment in MySQL • MySQL Focus Areas – Web, Embedded & Telecom – LAMP – Windows • Oracle + MySQL Customers – Oracle Enterprise Manager – Oracle Secure Backup – Oracle Audit Vault
  • 10. InnoDB will become default • ACID Transactions, FKs, Crash Recovery Improved Availability • Semi-synchronous Replication • Replication Heartbeat Improved Usability • SIGNAL/RESIGNAL • More Partitioning Options • PERFORMANCE_SCHEMA Better Instrumentation/Diagnostics • InnoDB stats in 5.5 PERFORMANCE_SCHEMA MySQL 5.5 RC
  • 11. InnoDB Performance improvements • Multiple Buffer Pool Instances • Multiple Rollback Segments • Extended Change Buffering (with delete buffering, purge buffering) • Improved Purge Scheduling • Improved Log Sys mutex • Separate Flush List mutex MySQL Performance Improvements • Better Metadata Locking within Transactions • Split LOCK_open mutex • Eliminated LOCK_alarm mutex as bottleneck • Eliminated LOCK_thread_count as bottleneck • Improved Performance/Scale on Win32, 64 More than 10x improvement in recovery times MySQL 5.5 is Faster! RC
  • 12. MySQL 5.5 SysBench Benchmarks Linux Intel Xeon X7460 x86_64 4 CPU x 6 Cores/CPU 2.66 GHz, 32GB RAM Fedora 10 MySQL 5.1.50 (InnoDB built-in) MySQL 5.1.50 (InnoDB Plug-in) MySQL 5.5.6 (New InnoDB) 200% performance gain for MySQL 5.5 over 5.1.50; at scale RC
  • 13. MySQL 5.5 SysBench Benchmarks Linux MySQL 5.1.50 (InnoDB built-in) MySQL 5.1.50 (InnoDB Plug-in) MySQL 5.5.6 (New InnoDB) Intel Xeon X7460 x86_64 4 CPU x 6 Cores/CPU 2.66 GHz, 32GB RAM Fedora 10 369% performance gain for MySQL 5.5 over 5.1.50; at scale RC
  • 14.
  • 15. PHP Extensions for MySQL PDO_mysql ext/mysql mysqli PHP
  • 16. ext/mysql • One of the first PHP extensions • Actively maintained with PHP 4 – No new features in PHP 5 • Exception: Added mysqlnd support with PHP 5.3 – Bug fixing only • Best documented database extension – Tons of books, tutorials, … • Missing support for many MySQL features – Prepared statements, Queries with multiple result sets (stored procedures), compression, encryption, full charset support, …
  • 17. PDO_mysql • “The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for accessing databases in PHP.” http://php.net/intro.pdo • Lowest common denominator • PHPish API • Broken by Design™
  • 18. $ php --rf PDO::sqliteCreateFunction Exception: Method PDO::sqliteCreateFunction() does not exist PDO – Broken by Design
  • 19. Intermezzo: Prepared Statements Client Server SELECT foo FROM bar WHERE id = 42 •Create Execution plan •Query database Resultset(s) query()
  • 20. Intermezzo: Prepared Statements Client Server SELECT foo FROM bar WHERE id = ? •Query database Resultset(s) Handle Handle Param 1: 42 •Create Execution plan prepare() execute()
  • 21. PDO – Broken by Design <?php $pdo = new PDO(“mysql:host=localhost;dbname=test”, “user”, “password”); $query = $pdo->prepare( “SELECT id FROM table LIMT ?, ?”); $query->bindValue(1, $_GET[“offset”]); $query->bindValue(2, $_GET[“limit”]); $query->execute();
  • 22. “The mysqli extension, or as it is sometimes known, the MySQL improved extension, was developed to take advantage of new features found in MySQL systems versions 4.1.3 and newer. […] If you are using MySQL versions 4.1.3 or later it is strongly recommended that you use this extension.” http://php.net/mysqli.overview What The PHP Manual Is Saying Extended(!) support for MySQL 4.0(!) ended 2008-09-30
  • 23. mysqli The Improved MySQL Extension • Full support for all MySQL features – Stored Procedures – Prepared Statements – Encryption (SSL) – Compression – Charsets – … • Actively developed, maintained and supported by Oracle
  • 24. PHP and mysqlnd PHP PHP Memory IO: PHP StreamsInfrastructure ext/mysql PDO_mysqlmysqli mysqlnd – MySQL native driver for PHP MySQL Server
  • 25. libmysql vs. mysqlnd MySQL Server MySQL Server mysqlnd libmysql PHP PHP PHP Memory libmysql Memory PHP Memory PHP Memory copy copy usedirectly copy
  • 26. Building PHP with mysqlnd • ./configure --with-mysql=mysqlnd --with-mysqli=msqlnd --with-pdo-mysql=mysqlnd • Default on Windows and some distributions
  • 27. mysqlnd Statistics • Around 150 statistic values collected • mysqli_get_client_stats (), mysqli_get_connection_stats()
  • 28. Asynchronous Queries /* Do something */ PHP Script MySQL query result query poll result $conn = new MySQLi(...); $conn->query( "SELECT * FROM t WHERE ....", MYSQLI_ASYNC); /* Process query results */ mysqli_poll($links, $errors, $reject, 1);
  • 30. Sharding foreach ($all_links as $link) $link->query("SELECT 'test' ", MYSQLI_ASYNC); $processed = 0; do { $links = $all_links; if (!mysqli_poll($links, $errors, $reject, 1)) continue; /* TIMEOUT */ foreach ($links as $link) { if ($result = $link->reap_async_query()) { print_r($result->fetch_row()); mysqli_free_result($result); $processed++; } } } while ($processed < count($all_links));
  • 31. mysqlnd plugins Plugin Hook mysqlnd Query mysqli::query()mysql_query() PDO::query() Wire Protocol Plugin Hook Network
  • 32. mysqlnd Plugins • “mysqlnd client proxy” – Load Balancing • Read / Write splitting • Failover – Monitoring • Query Logging • Query Auditing – Performance • Caching • Sharding
  • 33. The Database Is The Bottleneck
  • 35. # pecl install mysqlnd_qc-beta … and you are done! Almost at least ;-)
  • 36. mysqlnd Query cache • For more: • Ulf's presentation → Tomorrow 16:30 (German)
  • 37. Experimental Extensions • By Oracle: – mysqlnd_sip – mysqlnd_mc – mysqlnd_ms – mysqlnd_pscache • By Community: – mysqlnd_uh (David Soria Parra / Mayflower GmbH)
  • 38. mysqlnd_uh class ConnProxy extends MysqlndUHConnection { public function query($conn, $query) { if ($query == “SELECT 1”) { $query = “SELECT 2”; } return parent::query($conn, $query); } } mysqlnd_uh_set_connection_proxy(new ConnProxy());
  • 39. Key Takeaways • MySQL is important to Oracle and our customers – Part of our Complete, Open, Integrated strategy • Oracle is making MySQL better today – Major Feature, Performance, Scalability enhancements – 24x7, Global support in 145 countries Download Now http://dev.mysql.com/downloads Download Now http://dev.mysql.com/downloads