Chapter 8. memcached

Web applications are all about data. Being able to process data, both storing data that a user submits, as well as retrieving data to display, is the primary function of a web application. How fast and efficiently the application obtains that data is the most important issue pertaining to scalability. You have learned in this book that MySQL is a relational database system where data is organized and stored, and is the primary data source for web applications. Certainly, the database is the durable data store where all your data will be stored and available for the web application to use, however, having to retrieve data from a database does have a cost, depending on the type of database query executed and the subsequent result set that is retrieved.

Various types of data are frequently retrieved from the database for the application to function properly, including data that frequently changes, such as user or session data, as well as data that doesn't change as often, such as actual page content. Having to access the database for this data can affect performance significantly, and is a major scaling consideration.

This is where it would be useful not to have to always access the database to obtain this data—to have a cache. This is the problem that memcached solves.

What Is memcached?

memcached is a high-performance, distributed memory object caching system. It is essentially a simple memory server that provides a caching layer for applications to store data to ...

Get Developing Web Applications with Perl, memcached, MySQL® and Apache now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.