Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 20

Displaying posts with tag: PlanetPHP (en) (reset)

PECL/mysqlnd_ms: summer time, (connection) pool time – Fabric support internals
Employee +0 Vote Up -0Vote Down

The MySQL replication and load balancing plugin for PHP, PECL/mysqlnd_ms, aims to make using a cluster of MySQL servers instead of a single server as transparent as possible. Should you ever want to migrate your PHP app from a single MySQL server to any kind of MySQL cluster, install PECL/mysqlnd_ms and see how much breaks. A simple app, might need no code changes at all. Your APIs connect call remains unchanged, your query execution calls remain the same: one connection handle transparently switched to an appropriate cluster node (read-write splitting, weighted load

  [Read more...]
PECL/mysqlnd_ms: how failed XA transactions get fixed
Employee +0 Vote Up -0Vote Down

XA transactions are an open standard for distributed transactions. A distributed or global transaction can spawn multiple databases. XA transactions come handy, for example, when data sets are sharded over multiple servers and a business transaction affects multiple shards. The free MySQL Fabric tools help to setup and manage a sharded MySQL cluster. The development version of PECL/mysqlnd_ms 1.6 helps with XA transactions. It abstracts SQL details and acts as a transaction manager. The PHP MySQL driver kicks in when things go wrong and XA transactions show their nasty side: blocked servers. Good news: this is a rare case. Bad news: a

  [Read more...]
PECL/mysqlnd_ms: Distributed Transaction/XA support coming, e.g. for MySQL Fabric?
Employee +1 Vote Up -1Vote Down

The development version of PECL/mysqlnd_ms now has an very early version of distributed (2PC/XA) transaction support tailored for use with clusters of MySQL servers. XA transactions can span multiple servers in a cluster to ensure transaction guarantees among them. In real life, there is always, at some point, a sequence of work on your data for which atomicity, consistency, isolation, and durability must be given. The early generation of NoSQL sharding solutions has a weak spot here. How do you, as a developer, ensure a logical operation affecting two shards is either applied to both

  [Read more...]
PHP Unconference Europe, a legend. But lacking PHP…
Employee +1 Vote Up -0Vote Down

A legend is born: PHP Unconference Europe, Majorca. Nearly one hundred witnesses exist. The #phpuceu combines the proven concept of an unconference with the beauty of the island of majorca. Within a day after the end of the event, one third had bought a ticket for next years issue (May 9-10, 2015)! We all knew for years, unconferences work. We finally have one at a place that is easy to get and is just about perfect for any kind of visitor. Goal accomplished. Just a detail, PHP (partner happieness program) was missing…

The power of the people

Unconferences give power to the people. Participants gather in the morning to propose sessions and vote

  [Read more...]
Train your elePHPants for the PHP Unconf EU – Palma de Majorca!
Employee +1 Vote Up -0Vote Down

Majorca! May 2014 – 17./18! Could there be a better place and time on earth for the PHP EU Unconference: sun, fun, plenty of cheap flights, affordable accommodation? The PHP EU Unconference (tickets) is the international version of the national unconference. The national one frequently sells out quickly (>350 tickets) not only because it matches other conferences despite the ticket price of ~40 Euro only. Traditionally the international one, is more cosy with about 100 elePHPant lovers coming in the years before.

  [Read more...]
PHP mysqlnd memory optimizations: from 49MB to 2MB
Employee +0 Vote Up -0Vote Down

Inspired by Antony, Andrey has implemented a memory optimization for the PHP mysqlnd library. Depending on your usage pattern and the actual query, memory used for result sets is less and free’d earlier to be reused by the PHP engine. In other cases, the optimization will consume about the same or even more memory. The additional choice is currently available with mysqli only.

From the network line into your script

Many wheels start spinning when mysqli_query() is called. All the PHP MySQL APIs/extensions (mysqli, PDO_MySQL, mysql) use a client library that handles the networking details and provides a C API to the C extensions. Any recent PHP will default to use the mysqlnd library. The library speaks

  [Read more...]
The performance penalty of the early MySQL Fabric support for PHP
Employee +1 Vote Up -0Vote Down

PECL/mysqlnd_ms 1.6 is currently being modified to support sharding and fully automatic server and client failover when using MySQL Fabric (slides) to manage a farm of MySQL servers. PECL/mysqlnd_ms is a mostly transparent load balancer that works with all PHP MySQL APIs (PDO_MySQL, mysqli, …). The idea is, that if, for example, a MySQL server fails, the plugin talks to MySQL Fabric to learn about alternative servers that Fabric has provisioned automatically. This “talks to” gives implies a performance penalty for applications. One worth looking at, to

  [Read more...]
The early MySQL Fabric sharding support for PHP
Employee +0 Vote Up -0Vote Down

The MySQL Fabric framework brings two major features: automatic client- and server-side failover and sharding. The manual hints, you need a “Fabric aware driver” for this but it does not list one for PHP. First, you don’t necessarily need new drivers! Second, the "driver" for PHP is the current development version of the PECL/mysqlnd_ms replication and load balancing plugin. The plugin covers the sharding but not the failover/HA quickstart example of Fabric: how the plugin works and why you should not use the plugin – yet.

Partial  [Read more...]

Using MySQL Fabric from any programming language
Employee +2 Vote Up -0Vote Down

MySQL Fabric is a framework for MySQL Replication high availability, automatic failover and sharding. Technically, a MySQL Fabric daemon monitors a set of MySQL servers and takes appropriate actions upon failure. Clients use Fabric aware drivers to learn about failed servers and shards to distribute queries accordingly. Simple to understand, simple to sell, simple to raise false expectations and simple to fail [, dear Sales]. With the usual blog posts telling only the story of the first three sentences, major parts of the story are covered in silence.

Development preview = announcement of a vision != ready

You first challenge will be to find the documentation for the MySQL Fabric development preview. From the documentation overview page it takes three clicks down to the server side documentation for Fabric:

  •   [Read more...]
    PHP Memcache access to MySQL 5.7, faster? Redis?
    Employee +2 Vote Up -0Vote Down

    PHP users can use two client protocols to query MySQL 5.6 and later. Not only standard SQL access but also faster key-value access to InnoDB tables is possible using the Memcache protocol. The MySQL benchmark team reports crazy figures. Of course, on hardware that makes the average PHP meetup visitor roll his eyes and say “yeah, Oracle, *yawn*…”. I’ve repeated my plain PHP benchmarks on an i3 desktop. And, I’ve added Redis to the game.

    Short recap

    Some ten years ago, colleaguages teached me that some 50% of the time processing a simple SELECT column_a, column_b FROM table

      [Read more...]
    Data massage: how databases have been scaled from one to one million nodes
    Employee +0 Vote Up -0Vote Down

    Despite the CAP theorem, databases have been scaled from one to one million nodes. Globally distributed, highly available and fast. Databases supporting ACID transactions. How? A story and slides from a three hours workshop at the PHP Summit 2013 (Berlin)…

    Data massage: How databases have been scaled from one to one million nodes from Ulf Wendel

    Please note: long, deep dive, quite some theory. And,

      [Read more...]
    PHP: PECL/mysqlnd_ms 1.6 – automatic retry loop for transient errors
    Employee +1 Vote Up -0Vote Down

    PECL/mysqlnd_ms is client-side load balancing driver plugin for PHP MySQL that aims to increase distribution transparency when using any MySQL based cluster: failover, read-write splitting, abstraction on consistency (e.g. read-your-writes), partitioning/sharding support, … it’s all there. Until a few minutes ago, we had no special handling of transient errors. Sometimes a database server replies “come back in a bit and retry, no need to fail over yet”. And, that’s what

      [Read more...]
    PHP: PECL/mysqlnd_ms 1.5 alpha, mysqlnd_qc 1.1 alpha releases
    Employee +1 Vote Up -0Vote Down

    Just in time for a PHP 5.5 code freeze, we are brushing over the Replication and Load Balancing plugin (PECL/mysqlnd_ms) and the Query Cache plugin (PECL/mysqlnd_qc) for PHP mysqlnd. PECL/mysqlnd_ms 1.5 is a step up from the previous version whereas PECL/mysqlnd_qc 1.1 is nothing but a maintenance release.

    Replication and Load Balancing – better transaction awareness

    PECL/mysqlnd_ms 1.5 monitors all mysqli function calls that change transaction status. Since PHP 5.5, te mysqli API gives you the same level of transaction control as SQL does. Thus, if only using mysql function calls, the plugin can do fully transaction aware load

      [Read more...]
    PHP Summit presentation: NoSQL in MySQL
    Employee +2 Vote Up -0Vote Down

    Live from the PHP Summit conference in Munich: NoSQL in MySQL. A couple of hours ago I gave a talk about NoSQL in MySQL, contents: what is NoSQL, what is HandlerSocket, what is the InnoDB Memcached Plugin InnoDB and how to use with PHP, is this NoSQL? Slides are below.

    NoSQL in MySQL from Ulf Wendel

    (PDF download)

    The talk was called a night session. Night session means, its the last talk for the day. After eight hours packed with workshops everybody is a bit tired and exhausted. What else could I do but tell them

      [Read more...]
    PECL/mysqlnd_ms 1.5 + PHP 5.5.0 + MySQL 5.6 = better load balancing
    Employee +2 Vote Up -0Vote Down

    PECL/mysqlnd_ms is a client-side load balancer for PHP that supports any MySQL cluster. It does read-write splitting, failover, introduces a quality of service concept, supports partitioning and, of course, load balancing. New mysqli API (begin, *savepoint) calls in PHP 5.5.0 help to improve transaction awareness. New read only in MySQL 5.6 promise major performance gains (think 2x) and an option to reduce the load on a MySQL Replication master. Read how the features go together in PECL/mysqlnd_ms 1.5.

    Load balancing – transaction aware?

    A load balancer must not switch connections in the middle of a transaction. A load balancer must send all queries to the server a transaction has been started on until the transaction ends. Unfortunately, it is very hard to

      [Read more...]
    1.5x … 9x faster queries with PHP and MySQL 5.6, really?
    Employee +0 Vote Up -0Vote Down

    I am telling no secret saying MySQL 5.6 GA can be expected to be released soon, very soon. Time to test one of the improvements: MySQL 5.6 speaks SQL and Memcache protocol. In your PHP MySQL apps, try using the Memcache protocol to query MySQL. A key-value SELECT ... FROM ... WHERE pk = <key> can become 1.5x-2x faster, an INSERT INTO table(pk, ...) VALUES (<key> ...) can become 4.5x-9x faster, says the InnoDB team! Read on: background, benchmark, usage, PECL/mysqlnd_memcache,

      [Read more...]
    Solution for: MySQL 5.6 password expired, PHP can’t connect, application stops
    Employee +1 Vote Up -0Vote Down

    MySQL 5.6 introduces a new features that must be used with great care. A MySQL users password can be marked as expired. This way, a DBA can force a user to set or reset his password. The MySQL user must set a (new) password before he is allowed to do anything else. As a consequence, if a users password is expired all standard PHP MySQL API connect calls will fail. Applications stop working unless the application is changed to include a user dialog for setting a new password. To develop such a dialog for resetting an expired password one has to use a new connection flag introduced in PHP 5.4.12-dev. Don’t panic: to get in trouble DBA actions have to be at one level with dropping the MySQL user of a production PHP application…

    Relax: IF MySQL 5.6 AND IF …AND IF  [Read more...]

    PECL/mysqlnd_ms and the client failover dilemma – part 1
    Employee +0 Vote Up -0Vote Down

    MySQL Replication has a weak point: the master (primary) is a single point of failure. People ask frequently about client failover. Making a client library failover a client automatically from one server to another is simple. PECL/mysqlnd_ms can do it. Unfortunately, this is only the tip of the iceberg when using a primary copy (master-slave) database cluster. Among others, you may have to reconfigure clients. Below is one hint (no solution) for deploying PECL/mysqlnd_ms configuration files using MHA (Master High Availability Manager and tools for MySQL).

    What’s the plural of dilemma?

    If a server is unavailable a client may attempt to connect to another server given a list of alternatives. A client library can handle it entirely

      [Read more...]
    Some sharding support and cache locality optimization support for PHP MySQL driver
    Employee +5 Vote Up -0Vote Down

    It is time for christmas presents: some sharding support and cache locality optimizations are coming with PECL/mysqlnd_ms 1.5. PECL/mysqlnd_ms is a plugin for the mysqlnd library. The plugin adds replication and load balancing support to any PHP MySQL API (mysql, mysqli, PDO_MySQL) if compiled to use the mysqlnd library.

    As a MySQL user you can choose between a wide variety of clustering solutions to scale-out. Your options range from eventual consistent solutions to strong consistent ones, from built-in (MySQL Replication, MySQL Cluster) to third party or home-grown. PECL/mysqlnd_ms is a client side load

      [Read more...]
    Supercharging PHP MySQL applications using the best API
    Employee +3 Vote Up -0Vote Down

    PHP MySQL developers are confronted with three PHP MySQL APIs. That is confusing. Since mid 2012 the PHP manual suggests not to use the oldest and original PHP MySQL extension any more to cure the situation. Please, swap out ext/mysql in favour of either ext/mysqli or PDO_MySQL. Why to upgrade is below. Read on, if you are a PHP beginner, your PHP application is still using mysql_* functions of ext/mysql or you are a PHP trainer.

    As a PHP consumer, tease your software vendors by asking whether they use the state of the art APIs! Here is a cut&paste test question to ask your vendor: do you support secure SSL connections to MySQL?

    History  [Read more...]

    Showing entries 1 to 20

    Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

    Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.