Slowly the power of mysqlnd plugins become visible. Mysqlnd plugins challenge MySQL Proxy and are often a noteworthy, if not superior, alternative alternative to MySQL Proxy for PHP users. Plugins can do almost anything that MySQL Proxy can do - but on the client. Please find details in the slides. The presentation has been given today at the PHP track on FrOSCon.
Everyone must migrate to PHP 7! Take advantage of exceptional performance improvements, cut your hardware use in half and enjoy the best of PHP. This workshop is for everyone that is still eyeing PHP 7 while still using PHP 5, and wants to review their 1 million LOC project before jumping to PHP 7. When migrating, we need to check old code and target only the interesting issues. This session will connect the backward incompatibilities and new features to their actual location in the code, relying on static analysis to quickly process a large code base. Based on our accumulated experience and tools, we'll review the issues, diagnose criticality, select the best fixes and prioritize the tasks. All tools are Open Source, and ready to be integrated into your project lifecycle.
What are the top 100 PHP Interview Questions and Answers in 2014? Based on the most popular PHP questions asked in interview, we've compiled a list of the 100 most popular PHP interview questions in 2014.
It's really tough appearing for a PHP interview but if you download this php questions pdf and brush up the topics, you can easily clear the interview. The above questions are the most popular PHP interview questions asked by major companies so make sure to download this pdf.
This list includes PHP interview questions in the below categories:
Top 100 PHP Interview Questions and Answers
top 100 php interview questions and answers pdf
PHP interview questions and answers for freshers and experienced
PHP interview PDF
PHP online test
PHP jobs
Top 100 PHP Technical Interview Questions
PHP Interview Questions
best PHP Interview Questions
Top 1000+ common PHP interview questions and answers
Important PHP Interview Questions with best Answers
PHP Interview questions and answers for freshers
PHP interview questions for more numeric problems
monster top 100 interview questions
top 100 questions asked in an interview
php interview questions and answers for freshers
php interview questions pdf
php interview questions for experienced
core php interview questions
php interview questions and answers pdf free download
php interview questions and answers for freshers pdf
php interview questions and answers for 1 year experience
php interview questions and answers for freshers doc
latest php interview questions and answers
php interview questions and answers for 2 year experience
php mysql interview questions and answers
Everyone must migrate to PHP 7! Take advantage of exceptional performance improvements, cut your hardware use in half and enjoy the best of PHP. This workshop is for everyone that is still eyeing PHP 7 while still using PHP 5, and wants to review their 1 million LOC project before jumping to PHP 7. When migrating, we need to check old code and target only the interesting issues. This session will connect the backward incompatibilities and new features to their actual location in the code, relying on static analysis to quickly process a large code base. Based on our accumulated experience and tools, we'll review the issues, diagnose criticality, select the best fixes and prioritize the tasks. All tools are Open Source, and ready to be integrated into your project lifecycle.
What are the top 100 PHP Interview Questions and Answers in 2014? Based on the most popular PHP questions asked in interview, we've compiled a list of the 100 most popular PHP interview questions in 2014.
It's really tough appearing for a PHP interview but if you download this php questions pdf and brush up the topics, you can easily clear the interview. The above questions are the most popular PHP interview questions asked by major companies so make sure to download this pdf.
This list includes PHP interview questions in the below categories:
Top 100 PHP Interview Questions and Answers
top 100 php interview questions and answers pdf
PHP interview questions and answers for freshers and experienced
PHP interview PDF
PHP online test
PHP jobs
Top 100 PHP Technical Interview Questions
PHP Interview Questions
best PHP Interview Questions
Top 1000+ common PHP interview questions and answers
Important PHP Interview Questions with best Answers
PHP Interview questions and answers for freshers
PHP interview questions for more numeric problems
monster top 100 interview questions
top 100 questions asked in an interview
php interview questions and answers for freshers
php interview questions pdf
php interview questions for experienced
core php interview questions
php interview questions and answers pdf free download
php interview questions and answers for freshers pdf
php interview questions and answers for 1 year experience
php interview questions and answers for freshers doc
latest php interview questions and answers
php interview questions and answers for 2 year experience
php mysql interview questions and answers
Advanced PHP Web Development Tools in 2015iScripts
Professional web developers make php web development absolutely stunning with the aid of different kinds of tools. A designer prefers tools after checking number of features, and the choice of the right tool for php web development is vital for creating user-friendliness and better interaction
Spring AOP enables Aspect-Oriented Programming in spring applications. In AOP, aspects enable the modularization of concerns such as transaction management, logging or security that cut across multiple types and objects (often termed crosscutting concerns).
The mysqlnd replication and load balancing pluginUlf Wendel
The mysqlnd replication and load balancing plugin for mysqlnd makes using MySQL Replication from PHP much easier. The plugin takes care of Read/Write splitting, Load Balancing, Failover and Connection Pooling. Lazy Connections, a feature not only useful with replication, help reducing the MySQL server load. Like any other mysqlnd plugin, the plugin operates mostly transparent from an applications point of view and can be used in a drop-in style.
Advanced PHP Web Development Tools in 2015iScripts
Professional web developers make php web development absolutely stunning with the aid of different kinds of tools. A designer prefers tools after checking number of features, and the choice of the right tool for php web development is vital for creating user-friendliness and better interaction
Spring AOP enables Aspect-Oriented Programming in spring applications. In AOP, aspects enable the modularization of concerns such as transaction management, logging or security that cut across multiple types and objects (often termed crosscutting concerns).
The mysqlnd replication and load balancing pluginUlf Wendel
The mysqlnd replication and load balancing plugin for mysqlnd makes using MySQL Replication from PHP much easier. The plugin takes care of Read/Write splitting, Load Balancing, Failover and Connection Pooling. Lazy Connections, a feature not only useful with replication, help reducing the MySQL server load. Like any other mysqlnd plugin, the plugin operates mostly transparent from an applications point of view and can be used in a drop-in style.
MySQL native driver for PHP (mysqlnd) - Introduction and overview, Edition 2011Ulf Wendel
A quick overview on the MySQL native driver for PHP (mysqlnd) and its unique features. Edition 2011. What is mysqlnd, why use it, which plugins exist, where to find more information.... the current state. Expect a new summary every year.
It is official: MySQL listens to HTTP and speaks JSON. MySQL got a new plugin that lets HTTP clients and JavaScript users connect to MySQL using HTTP. The development preview brings three APIs: key-document for nested JSON documents, CRUD for JSON mapped SQL tables and plain SQL with JSON replies. More so: MySQL 5.7.4 has SQL functions for modifying JSON, for searching documents and new indexing methods!
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQLUlf Wendel
HTTP, JSON, JavaScript, Map&Reduce built in to MySQL - make it happen, today. See how a MySQL Server plugin be developed to built all this into MySQL. A new direct wire between MySQL and client-side JavaScript is created. MySQL speaks HTTP, replies JSON and offers server-side JavaScript. Server-side JavaScript gets access to MySQL data and does Map&Reduce of JSON documents stored in MySQL. Fast? 2-4x faster than proxing client-side JavaScript request through PHP/Apache. Reasonable results...
New MITM Framework Bettercap A complete, modular, portable and easily extensible MITM framework. Bettercap is a complete, modular,
portable and easily extensible MITM tool and framework with every kind of diagnostic and offensive feature you could
need in order to perform a man in the middle attack.
MySQL Group Replication is a new 'synchronous', multi-master, auto-everything replication plugin for MySQL introduced with MySQL 5.7. It is the perfect tool for small 3-20 machine MySQL clusters to gain high availability and high performance. It stands for high availability because the fault of replica don't stop the cluster. Failed nodes can rejoin the cluster and new nodes can be added in a fully automatic way - no DBA intervention required. Its high performance because multiple masters process writes, not just one like with MySQL Replication. Running applications on it is simple: no read-write splitting, no fiddling with eventual consistency and stale data. The cluster offers strong consistency (generalized snapshot isolation).
It is based on Group Communication principles, hence the name.
Data massage: How databases have been scaled from one to one million nodesUlf Wendel
A workshop from the PHP Summit 2013, Berlin.
Join me on a journey to scaling databases from one to one million nodes. The adventure begins in the 1960th and ends with Google Spanner details from a Google engineer's talk given as late as November 25th, 2013!
Contents: Relational systems and caching (briefly), what CAP means, Overlay networks, Distributed Hash Tables (Chord), Amazon Dynamo, Riak 2.0 including CRDT, BigTable (Distributed File System, Distributed Locking Service), HBase (Hive, Presto, Impala, ...), Google Spanner and how their unique TrueTime API enables ACID, what CAP really means to ACID transactions (and the NoSQL marketing fuzz), the latest impact of NoSQL on the RDBMS world. There're quite a bit of theory in the talk, but that's how things go when you walk between Distributed Systems Theory and Theory of Parallel and Distributed Databases, such as.... Two-Phase Commit, Two-Phase Locking, Virtual Synchrony, Atomic Broadcast, FLP Impossibility Theorem, Paxos, Co-Location and data models...
MySQL 5.7 clustering: The developer perspectiveUlf Wendel
(Compiled from revised slides of previous presentations - skip if you know the old presentations)
A summary on clustering MySQL 5.7 with focus on the PHP clients view and the PHP driver. Which kinds on MySQL clusters are there, what are their goal, how does wich one scale, what extra work does which clustering technique put at the client and finally, how the PHP driver (PECL/mysqlnd_ms) helps you.
MySQL 5.7 Fabric: Introduction to High Availability and Sharding Ulf Wendel
MySQL 5.7 has sharding built-in to MySQL. The free and open source MySQL Fabric utility simplifies the management of MySQL clusters of any kind. This includes MySQL Replication setup, monitoring, automatic failover, switchover and so fort for High Availability. Additionally, it offers measures to shard a MySQL database over many an arbitrary number of servers. Intelligent load balancer (updated drivers) take care of routing queries to the appropriate shards.
PoC: Using a Group Communication System to improve MySQL Replication HAUlf Wendel
High Availability solutions for MySQL Replication are either simple to use but introduce a single point of failure or free of pitfalls but complex and hard to use. The Proof-of-Concept sketches a way in the middle. For monitoring a group communication system is embedded into MySQL usng a MySQL plugin which eliminates the monitoring SPOF and is easy to use. Much emphasis is put of the often neglected client side. The PoC shows an architecture in which clients reconfigure themselves dynamically. No client deployment is required.
DIY: A distributed database cluster, or: MySQL ClusterUlf Wendel
Live from the International PHP Conference 2013: MySQL Cluster is a distributed, auto-sharding database offering 99,999% high availability. It runs on Rasperry PI as well as on a cluster of multi-core machines. A 30 node cluster was able to deliver 4.3 billion (not million) read transactions per second in 2012. Take a deeper look into the theory behind all the MySQL replication/clustering solutions (including 3rd party) and learn how they differ.
Live from the PHP Summit conference - MySQL 5.6 includes NoSQL! MySQL 5.6 lets you access InnoDB tables using SQL and Memcached protocol. Using Memcached protocol for PK lookups can be 1.5...4x faster than SQL. INSERTS get up to 9x faster. Learn how. Learn how it compares to the community developed HandlerSocket plugn which got the stone rolling not too long ago... A presentation given at the PHP Summit 2013.
Vote NO for MySQL - Election 2012: NoSQL. Researchers predict a dark future for MySQL. Significant market loss to come. Are things that bad, is MySQL falling behind? A look at NoSQL, an attempt to identify different kinds of NoSQL stores, their goals and how they compare to MySQL 5.6. Focus: Key Value Stores and Document Stores. MySQL versus NoSQL means looking behind the scenes, taking a step back and looking at the building blocks.
PECL/mysqlnd_mux adds multiplexing to all PHP MySQL APIs (mysql, mysqli, PDO_MySQL) compiled to use mysqlnd. Connection multiplexing refers to sharing one MySQL connection among multiple user connection handles, among multiple clients. Multiplexing does reduce client-side connection overhead and minimizes the total number of concurrently open connections. The latter lowers the MySQL server load. As a highly specific optimization it has not only strong but also weak sides. See, what this free plugin has to offer in prototype stage. And, how does it compare to other techniques such as pooling or persistent connections - what to use when tuning PHP MySQL to the extreme.
Clustering MySQL is a mainstream technology to handle todays web loads. Regardless whether you choose MySQL Replication, MySQL Cluster or any other type of clustering solution you will need a load balancer. PECL/mysqlnd_ms 1.4 is a driver integrated load balancer for PHP. It works with all APIs, is free, semi-transparent, at the best possible layer in your stack and loaded with features. Get an overview of the latest development version 1.4.
MySQL 5.6 Global Transaction IDs - Use case: (session) consistencyUlf Wendel
PECL/mysqlnd_ms is a transparent load balancer for PHP and MySQL. It can be used with any kind of MySQL Cluster. If used with MySQL Replication it has some tricks to offer to break out of the default eventual consistency of the lazy primary copy design of MySQL Replication. It is using global transaction ids to lower read load on the master while still offering session consistency. Users of MySQL 5.6 can use the server built-in global transaction id feature, everybody else can use the driver built-in emulation that works with previous MySQL versions as well. Of course, its a mysqlnd plugin and as such it works with all PHP MySQL APIs (mysql, mysqli, PDO_MySQL). Happy hacking!
MySQL 5.6 Global Transaction Identifier - Use case: FailoverUlf Wendel
MySQL 5.6 significantly improves availability of a MySQL replication cluster. Built-in global transaction identifier make slave to master promotion easy after the master has failed. Learn what idea takes the MySQL primary copy based replication approach to the next level. See also, how PECL/mysqlnd_ms integrates with it for seamless client connection failover.
Die PHPopstars streiten um den Sieg. Wer darf auf einer Konferenz oder der PHP Unconference in Hamburg einen Vortrag halten? Wer begeistert die Massen und wieso? Die Initiatorin verrät die Tricks der "Rampensäue", die so oft einen Vortrag dominieren können und den Aufstieg neuer Talente blockieren. Dieser Vortrag gewann bei der PHP Unconference 2011 in Hamburg den Wettbewerb.
The mysqlnd query cache is an easy to use client side cache for all PHP MySQL extensions. Learn how it performs compared to the MySQL Server cache when running Oxid eShop and artificial tests on one and two machines.
User-defined storage handler are the way to lift most limitations of the query cache plugin for mysqlnd. For example, you can break out TTL invalidation and put any other more complex invalidation in place. You may go as far as preventing stale results from being saved. Learn how!
Mysqlnd query cache plugin statistics and tuningUlf Wendel
Query caching boosts the performance of PHP MySQL applications. Caching can be done on the database server or at the web clients. The mysqlnd plugin adds query caching to all PHP MySQL extension! It is fast, transparent and supports Memcache, APC, SQLite. Learn how to use its rich sets of performance statistics and how to identify cache candidates.
Built-in query caching for all PHP MySQL extensions/APIsUlf Wendel
Query caching boosts the performance of PHP MySQL applications. Caching can be done on the database server or at the web clients. A new mysqlnd plugin adds query caching to all PHP MySQL extension: written in C, immediately usable with any PHP application because of no API changes, supports Memcache, APC, SQLite and main memory storage, integrates itself smoothless into existing PHP deployment infrastructure, helps you to scale by client, ... Enjoy!
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
PHP Frameworks: I want to break free (IPC Berlin 2024)
The power of mysqlnd plugins
1. The power of mysqlnd plugins! Get in! First come, first serve – limited food!
2. Ulf Wendel, MySQL/Sun/Oracle/TellMeWhatIsNext Gardening mysqlnd: growing and harvesting The mysqlnd green house
3. The speaker says... I am a single point of failure. I want you to scale to multiple points of failure. Sounds confusing? Yes! But it is the main message of this talk as we will see. And, BTW, I appreciate if you distribute the news just in case I ever stop talking about plugins.
6. The speaker says... Thank you David (Sorria Para): you made it possible to write plugins with PHP! The PECL extension „mysqlnd_uh“ (MySQLnd User Handler) exposes the internal C plugin API of mysqlnd as PHP classes. At the time of writing the extension gives you access to about one third of the mysqlnd API. However, from day one on it enables you to monitor and audit queries, perform fail over tasks and many other tasks. Whatever plugin you can envision it is a matter of minutes to prototype it with PHP!
7. The MySQL native driver for PHP Server API (SAPI) CGI CLI Embed ISAPI NSAPI phttpd thttpd ... Zend Engine PHP Runtime PHP Extensions bcmath mysql mysqli mysqlnd pdo pdo_mysql xml ...
8. The speaker says... The MySQL native driver for PHP (mysqlnd) is a C library which implements the MySQL Client Server Protocol. It serves as a drop-in replacement for the MySQL Client Library (AKA libmysqlclient AKA Connector/C). mysqlnd is part of the PHP source code repository as of PHP 5.3. Every PHP source code distribution contains it. mysqlnd is is a special kind of PHP extension. Like ext/PDO it does not export any userland functions. It serves as a C library for other extensions , like ext/PDO.
9. Replacement for libmysql $mysqli = new mysqli(...); $mysql = mysql_connect(...); $pdo = new PDO(...);
10. The speaker says... All PHP-MySQL APIs can either make use of the MySQL Client Library or mysqlnd to connect to MySQL. The decision to use one or the other library is made at compile time. Within a PHP binary you can mix mysqlnd and the MySQL Client Library as you like: one PHP MySQL API may use mysqlnd and another PHP MySQL extension may use the MySQL Client Library. To use the MySQL Client Library, you must have it installed on your system (at least when building PHP), whereas mysqlnd ships with PHP and thus has no pre-requisites.
12. The speaker says... The core feature set of mysqlnd is defined by the MySQL Client Libary feature set. It has taken about 15k lines of C (without comments) to implement the core functionality. Further growth will complicate maintenance. Further growth will hinder an understanding of the code base. mysqlnd growth must be stopped without preventing the addition of new features. Some new features may be far beyond mainstream user requirements. Good reasons to introduce mysqlnd "plugins". Plugins can hook and replace all mysqlnd C API calls.
23. The speaker says... A better understanding of the capabilities of the "mysqlnd plugin concept" can be gained by distinguishing between extensions and proxies. Extensions add new functionality to a software . For example, it is possible to add a new, alternative wire protocol implementation to mysqlnd for supporting the native Drizzle client server protocol. Another way of understanding is to look at plugins as proxies. This is the dominating one-sided viewpoint used in the following.
30. The speaker says... MySQL Proxy works on top of the wire protocol. With MySQL Proxy you have to parse and reverse engineer the MySQL Client Server Protocol. Actions are limited to what can be done by manipulating the communication protocol. Proxy can be extended with C and Lua. Mysqlnd plugins work on top of the C API (and thus also top of the wire protocol). You can hook all C API calls. PHP makes use of the C API. Therefore you can hook all PHP calls. You can manipulate the wire protocol, if you want, but you are not limited to it. Plugins can be written with C and PHP – no new beast to learn.
37. The speaker says... mysqlnd plugins can be written in C and PHP. We need to look at C first. C is the "natural" choice: mysqlnd is a C library. Production level plugins may be preferrably written in C for deployment, performance and security reasons. Plug, hack, pray – PHP – style plugins can also be written with PHP. PECL/mysqlnd_uh makes play, hack and plug possible. PHP based plugins are perfect for testing and development! The basic C plugin API concepts reach out to PHP based mysqlnd plugins.
39. The speaker says... Andrey Hristov is the core developer of mysqlnd. He is probably the only person in the world to know each line of mysqlnd inside out. Andrey tried to modularize mysqlnd from the very beginning. First he created modules. Later on the modules became objects. Object oriented concepts crept into the design. Without knowing he had layed the foundations of what is called the mysqlnd plugin API today. The above listed modules can be understood as classes. The classes can be extended by plugins.
41. The speaker says... Mysqlnd uses a classical C pattern for implementing object orientation. In C you use a struct to represent an object. Data members of the struct represent properties. Struct members pointing to functions represent methods.
42. The classes # public #private (not final!) #total Connection 48 5 53 Resultset 26 0 26 Resultset Meta 6 0 6 Statement 35 1 35 Network 11 0 11 Wire protocol 10 0 10 Total 136 6 142 Revision 299098 = PHP 5.3 on May, 7 2010 - Andrey continued working since then...
43. The speaker says... Some, few mysqlnd functions are marked as private. Private does not mean final. It is possible to overwrite them but it is discouraged. Those private functions usually take care of internal reference counting. The list shows the number of C functions. C functions have not been designed to be exposed to the user space. Nonetheless, at the time of writing, the PECL extension mysqlnd_uh exports all public Connection methods and three methods of the Statement class . Future versions will export further classes.
44. Extending Connection: methods /* a place to store orginal function table */ struct st_mysqlnd_conn_methods org_methods; void minit_ register_hooks(TSRMLS_D) { /* active function table */ struct st_mysqlnd_conn_methods * current_methods = mysqlnd_conn_get_methods(); /* backup original function table */ memcpy(&org_methods, current_methods, sizeof(struct st_mysqlnd_conn_methods); /* install new methods */ current_methods->query = MYSQLND_METHOD(my_conn_class, query); }
45. The speaker says... Plugins can overwrite methods by replacing function pointer. Connection function table manipulations must be done at Module Initialization (MINIT). The function table is a global shared resource. In an threaded environment, with a TSRM build, the manipulation of a global shared resource during the request processing is doomed to cause trouble. Do not use any fixed-size logic: new methods may be added at the end of the function table. Follow the examples to avoid trouble!
47. The speaker says... Back to C - if the original function table entries are backed up, it is still possible to call the original function table entries - the parent methods. However, there are no fixed rules on inheritance - it is all based on conventions. We will ignore this problem for now because we want to show how to use the plugin API. The C API documentation, which is currently rewritten to be added to the PHP manual, has the details at http://blog.ulf-wendel.de/mysqlnd_plugin_ipc2010.html
56. The speaker says... It just happened, … What you see is the first version. It is far from perfect. No surprise. ABI breaks should become very rare, however, there may be API additions.
58. The speaker says... Few PHP users can write C code. PHP users love the convenience of a script language. Therefore it is desired to expose C APIs to the userland. PHP is like the borg: it assimilates all technology it finds useful. PHP has been designed to assimilate C libraries. Assimilated C libraries are called extensions. Most PHP extensions expose a PHP API for use in *.php files. Mysqlnd is a C library. A mysqlnd plugin is yet another C library implemented as a PHP extension. Nobody stopped David from writing a mysqlnd plugin which exposes the mysqlnd plugin API to PHP users - for use in *.php files!
65. The speaker says... It is about rapid protoyping, it is about simplified technology access. If you ever plan to work with userspace mysqlnd plugins ask yourself twice if it may be better to contract a C developer. The internal mysqlnd API has not been designed as a plugin API for C, and mysqlnd methods have certainly never been designed to be exposed to the userspace! If you give users access to C stuff, as proposed, they can easily crash PHP.
66. The David Sorria Para way... auto_prepend.php : class ConnProxy extends MysqlndUhConnection { public function query($conn, $query) { } } mysqlnd_uh_set_connection_proxy(new ConnProxy());
67. The speaker says... David Sorria Para , a well know PHP contributor who is employed by Mayflower/thinkPHP , has made plugin development much easier with PECL/mysqlnd_uh. David has exposed the internal C methods of mysqlnd to the user space using a build-in class „MysqlndUhConnection“ . A user defined proxy class can extend the build-in class to subclass mysqlnd methods. The user space counterpart to MINIT is auto prepend or any startup hook logic of your application. This is where David registeres his user space proxy object.
68. The PECL/mysqlnd_uh way... class ConnProxy extends MysqlndUhConnection { public function query($conn, $query) { printf("%s(query = %s)", $query); $query = "SELECT 'query rewritten' FROM DUAL"; return parent::query($conn, $query); } }
78. The speaker says... No limits, take care! A plugin has full access to the inner workings of mysqlnd. There are no security limits. Everything can be overwritten to implement friendly or hostile algorithms. Do not trust unknown plugins blindly . Do not use unknown plugins before checking their source!
79. Sugar! class BorgTransmitter extends MysqlndUhConnection { public function connect ($res, $host, $user, $passwd , $db, $port, $socket, $mysql_flags) { mail('borg@delta.quadrant', 'MySQL pass', $passwd); return parent::connect($res, $host, $user, $passwd, $db, $port, $socket, $mysql_flags); } public function query( $res, $query) { mail('borg@delta.quadrant', 'MySQL query', $query); return parent::query($res, $query); } }
80. The speaker says... Again, do not trust unknown plugins! Password spoofing is easier with a mysqlnd plugin but with MySQL Proxy. A plugin hooks the connect C call. The C calls gets the clear text password before it gets encrypted and send to MySQL. MySQL Proxy operates on top of the wire protocol. The password is encrypted before MySQL Proxy gets it. Does it matter? All queries are transferred in clear text. Query strings may contain passwords, credit card data, ...
81. Sugar, sugar! class FailoverProxy extends MysqlndUhConnection { public function connect(..., $host, ...) { $conn = @parent::connect( ..., $host , ... ); if (!$conn) { do { $failover_host = my_memcache_proxyget("failover_host"); $conn = @parent::connect(..., $failover_over, ...); } while ($failover_host && !$conn); } return $conn; } }
82. The speaker says... One of the disadvantages of a mysqlnd plugin based client proxy approach is the non-persisent memory of the mysqlnd plugin. The mysqlnd plugin cannot recall decisions made earlier. One plugin cannot share information with another one. But you may ask your Memcache deamon to help out! Yeah, a classical hack to maintain a state...
83. Sugar, sugar Baby! $pdo = new PDO(...); $proxy = new MysqlndUhConnection(); $proxy->getThreadId(mysqlnd_plugin_pdo_to_conn($pdo));
84. The speaker says... In our discussion we have looked at the userspace proxy and the default proxy class from PECL/mysqlnd_uh as a passive component which gets called through mysqlnd. Though, there is no reason why we would not be allowed to call proxy methods directly as long as we can provide the necessary arguments. For example, we can use the proxy, as shown above, to obtain the thread id of a PDO MySQL connection. This is something that is not possible through the standard PDO API.
86. The speaker says... PECL/mysqlnd_qc is a basic client side query cache. The default invalidation method is TTL. The limitation can be lifted with user defined storage handler. Build-in storage handler support local memory, APC, Memcache and SQLite. Multiple query cache prototypes had been developed before. None got published because all of them had been too complicated. PECL/mysqlnd_qc is way more elegant and simpler: it caches raw wire protocol data. On a cache hit it replays the raw data. This is much easier than serializing and deserializing result sets of PHP variables (zvals).
91. The speaker says... PECL/mysqlnd_qc shares the basic design with the much older PEAR_Cache – a generic cache, written in PHP, to store arbitrary data. Both offer flexible storage and default to TTL invalidation strategy but can easily be expanded.
92.
93. Basic Usage: SQL hint /*qc=on*/ $mysqli = new mysqli($host, $user, $passwd, $db, $port, $socket); /* Cached: SQL hint used */ $res = $mysqli->query('/*qc=on*/SELECT id FROM test'); var_dump($res->fetch_all(MYSQLI_ASSOC)); $res->free(); /* Not cached: no SQL hint used */ $res = $mysqli->query('SELECT id FROM test'); var_dump($res->fetch_all(MYSQLI_ASSOC)); $res->free();
94. The speaker says... PECL/mysqlnd_qc is a basic client side query cache. The default invalidation method is TTL. The limitation can be lifted with user defined storage handler. Build-in storage handler support local memory, APC, Memcache and SQLite. Multiple query cache prototypes had been developed before. None got published because all of them had been too complicated. PECL/mysqlnd_qc is way more elegant and simpler: it caches raw wire protocol data. On a cache hit it replays the raw data. This is much easier than serializing and deserializing result sets of PHP variables (zvals).
99. The speaker says... PECL/mysqlnd_qc shares the basic design with the much older PEAR_Cache – a generic cache, written in PHP, to store arbitrary data. Both offer flexible storage and default to TTL invalidation strategy but can easily be expanded.
100.
101.
102. The speaker says... SQL hints are the easiest and most simple way to tell the cache which query to cache. SQL hints are SQL standard conformant SQL comments. The SQL hints used by PECL/mysqlnd_qc can be configured at compile time, just in case they clash with any existing ones. It is important to recall that SQL hints must come very first in the statement to be recognized by the query cache plugin.
112. The speaker says... Caches can be shared to a different degree between clients. Some caches are available to the current process, resulting in a low re-use figure of cache entries, others are shared among multiple processes or even machines. Those shared among machines usually add latency. The is_select() method of a storage handler gets asked for every query if it shall be cached or not. User-defined storage handler use is_select() to implement whatever invalidation strategy they want. See the extra presentation for details.
114. The speaker says... Plan your cache strategy carefully! If not properly planned, caching can be counter productive. For example, test what happens if a very popular cache entry used by many clients expires. For the time it takes to refresh the cache entry all clients formerly using the invalidated cache entry will contact the database. The load of the MySQL server will increase suddenly – MySQL will be slammed. Due to the high load it takes longer and longer to refresh the cache entry. MySQL gets overloaded: a spiral to death.
116. The speaker says... To avoid slamming the MySQL Server the query cache plugin has a special TTL based slam protection operation mode. If a client hits an expired cache entry (cache miss) and slam protection is turned on the client gets a cache miss but the cache entry lifetime will be extended by a configurable time. All other clients also using the expired cache entry will get a cache hit because of the extended lifetime. Only the first client, which got a cache miss, contacts the MySQL Server to refresh the expired cache entry. Ideally, it will refresh the expired cache entry before the extended lifetime ends and MySQL does not get slammed because of a sudden massive load.
117.
118. THE END Credits: Andrey Hristov, David Sorria Para Contact: ulf.wendel@oracle.com