memcached Functions for MySQL: Seemless Caching in MySQL

Architecture and Technology, Cloud Computing, LAMP
Location: Ballroom B Level: Intermediate
Average rating: ****.
(4.00, 1 rating)

memcached is a popular, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. memcached is used by numerous well-known websites, as well as officially being supported by Sun/MySQL.

The memcached Functions for MySQL, written by Patrick Galbraith, are user defined functions (UDFs) that utilize the libmemcached C client libraries (Brian Aker) that give the developer all the functionality that they need to interact with memcached from within MySQL. This has a number of advantages:

  • Provide some level of integration of MySQL and memcached.
  • Logic that would otherwise have to be in the application can be pushed into the database.
  • Both database and memcached interaction in one place.
  • Both read-through and write-through caching can be accomplished using a number of means such as using triggers on inserts, updates, or deletes to automatically perform the similar action within memcached.
  • Data is transferred to and from memcached is using a fast, C-based library vs. other language specific drivers.
  • Complete functional implementation of all libmemcached calls are available with these UDFS
  • memcached statistics are avaiable via the database

This presentation will show the developer how to

  • Install the UDFs
  • How to write queries, views, and stored procedures for read-through caching
  • How to write triggers to use the UDFs for write-through caching
  • How to move functionality from a web application (mod_perl) to using the UDFs.
  • Question and answer session

The developer will leave this session with a good idea of how to install, use, deploy these UDFs for use in their applications.

Photo of Patrick Galbraith

Patrick Galbraith

Hewlett Packard

Patrick Galbraith is a principal engineer at HP in the Advanced Technology Group. He is the author or two books: “Developing Web Applications with Apache, MySQL, memcached, and Perl” (Wiley) “Expert PHP and MySQL” (Wiley) In his “spare time”, he also maintains DBD::mysql, DBD::drizzle, FederatedX storage engine and the Memcached Functions for MySQL as well as tinkering with various other OpenSource and OpenStack projects. Patrick lives up in the sticks of New Hampshire with his wife Ruth and son Kiran, daughter Sara, lots of trees and rocks, as well as his Kubota tractor.

Co-presented By:

O'Reilly Media MySQL/Sun Microsystems
  • Kickfire
  • Virident
  • Infobright, Inc
  • JasperSoft
  • Intel
  • Advanced Micro Devices
  • BIRT Exchange by Actuate
  • Calpont
  • Canonical
  • Continuent
  • Dolphin Interconnect Solutions
  • Facebook
  • HiT Software, Inc.
  • IBM
  • iDashboards
  • Oracle
  • Pentaho
  • R1Soft
  • Schooner Information Technology
  • SQLstream
  • Ticketmaster
  • Zmanda, Inc.
  • Linux Journal

Sponsorship Opportunities

For information on exhibition and sponsorship opportunities at the conference, contact Sharon Cordesse at

Download the MySQL Sponsor/Exhibitor Prospectus

Media Partner Opportunities

Download the Media & Promotional Partner Brochure (PDF) for information on trade opportunities with O'Reilly conferences or contact mediapartners@

Press and Media

For media-related inquiries, contact Maureen Jennings at

MySQL Conference Newsletter

To stay abreast of conference news and to receive email notification when registration opens, please sign up for the MySQL Conference newsletter.

Contact Us

View a complete list of MySQL contacts.