Chapter 12. Contact List Application

You've read about MySQL and everything you'd want to know about it. You've also read about both memcached and Apache. Now, you'll see just how all of these can fit together in a way for you to build a practical web application—with MySQL for the data store and memcached to provide a caching layer for this application.

This chapter shows you the complete implementation of a contact list application, which allows you to add or edit contacts through an HTML form, save the contact, and then provide a listing of the existing contacts. In this chapter, this application will be a CGI application using both MySQL and memcached. It will use basic HTML design and style sheets to present a clean, simple user interface. The following chapter will show how you can turn this CGI application into a mod_perl application.

Using MySQL and memcached Together

The purpose of showing you this application's implementation is to demonstrate how you can use MySQL and memcached together to provide data to a web application, with the focus being how to implement caching. The application looks simple on the surface, but there is some complex functionality at a lower level that ensures that caching is working properly.

Also, this application will introduce you to handling CGI and web programming, particularly how to process submitted form values. For this application, the CGI.pm Perl module will be used to provide a means of obtaining those submitted form values, as well as ...

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.