Beginner's Guide to Website Performance with MySQL and memcached

Architecture and Technology, LAMP, PHP and MySQL
Location: Ballroom E Level: Novice
Average rating: ***..
(3.33, 3 ratings)

Memcached is a distributed memory object caching system that is getting a lot of press at the moment for its ability to provide a high-performance front-end for database applications. Sure, memcached can do wonders, but where is it most effective and what are the pain points?

When a site grows the site administrator starts to worry about how to maintain performance as the hit count rises. Should extra hardware be thrown at the problem synchronisation issues start to rear their heads. Writing caching code is sometimes problematic and you have to be sure that the target of the caching warrants the extra code overhead. Memcached can assist in this phase (and through the majority of the growth phase of the site), however it is sometimes difficult to work out where and how to implement memcached for the best performance.

When found it had started to hit limits of performance the web team looked for tools to help handle the load. On the top of the list was memcached, chosen primarily for its simplicity and utility. Because it is agnostic to the data being stored memcached can be used for just about any application that can store and retrieve data by key. The distributed nature also allowed building a resilient solution, without the need for extra hardware.

In this session Adam Donnison will take you through the decision making process leading to the deployment of memcached on the web stack. In a step-by-step manner with real-world examples in PHP and MySQL 5.1, Adam will cover:

  • Basic architecture of a memcached-enabled web application
  • Setup of memcached on single and multiple servers
  • Identifying code targets that can benefit from memcached
  • How memcached can assist with replication lag
  • When not to use memcached
  • How to write code to take advantage of memcached
  • Handling cache timeouts and missing data
  • Building PHP classes to ease memcached integration in your web application stack
Photo of Adam Donnison

Adam Donnison

Sun Microsystems

Adam is currently a member of the team responsible for the websites. He was primarily responsible for the design of the current web infrastructure, which now achieves an enviable uptime, showing that it can be done with open source and commodity hardware.

In previous incarnations Adam has been an analyst programmer, consultant, systems engineer, trainer and courseware developer.

Comments on this page are now closed.


Picture of Sheeri K. Cabral
Sheeri K. Cabral
07/30/2009 2:22am PDT

Watch the full video online at YouTube (much easier)

Picture of Sheeri K. Cabral
Sheeri K. Cabral
07/06/2009 9:35am PDT

People have reported that the “play” link loads for 15-20 minutes before actually streaming the content; however, the download link works just fine. I apologize for any inconvenience.

Picture of Sheeri K. Cabral
Sheeri K. Cabral
06/25/2009 12:41am PDT

Play the video directly in your browser at or download it at

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.