Michael Kruckenberg is a senior programmer at Tufts University, working on the Apache/Perl/MySQL-driven Tufts University Sciences Knowledgebase (TUSK), a content repository for faculty and students. He has worked with web technologies since 1994, primarily in open source. He has a passion for exploring new technologies and is awed by the power and progress of the open source community.
Jay Pipes has 11 years experience architecting and building a variety of applications on both Microsoft and various open source platforms. Following a stint as a senior programmer for RadioShack, Jay has spent the last three years running his own consulting service, where he devotes his time to writing and customizing web applications.
Pro MySQL, a brand new book by Mike Kruckenberg and Jay Pipes (Apress, July 2005, ISBN 1-59059-505-X), provides intermediate and advanced MySQL users with a comprehensive guide to the array of features available in MySQL upto and including MySQL 5.0
Since the MySQL Developer Zone has had quite a few articles related to the new MySQL 5.0 features, we chose to publish chapter 6 covering another hot topic, "Benchmarking and Profiling".
This is one of the first books to cover MySQL 5 in depth. It foregoes the usual reiteration of basics that you'll find in other books, instead concentrating on MySQL's advanced applications in enterprise environments. Further, this book doubles as a quick reference guide for configuration directives, commands, and features.
The book's own companion web site is at http://www.promysql.com/
This book departs from novice or intermediate texts in that we focus on using and developing for MySQL from a professional angle. We don't think the difference between a normal user and a professional user lies in the ability to recite every available function in MySQL's SQL extensions, nor in the capacity to administer large databases or high-volume applications.
Rather, we think the difference between a novice user and a professional is twofold. First, the professional has the desire to understand why and how something works. Merely knowing the steps to accomplish an activity is not enough. Second, the professional approaches a problem with an understanding that the circumstances that created the problem can and will change over time, leading to variations in the problem's environment, and consequently, a need for different solutions. The professional developer or administrator focuses on understanding how things work, and sets about to build a framework that can react to and adjust for changes in the environment.
The subject of benchmarking and profiling of database-driven applications addresses the core of this professional outlook. It is part of the foundation on which the professional's framework for understanding is built. As a professional developer, understanding how and why benchmarking is useful, and how profiling can save you and your company time and money, is critical.
As the size of an application grows, the need for a reliable method of measuring the application's performance also grows. Likewise, as more and more users start to query the database application, the need for a standardized framework for identifying bottlenecks also increases. Benchmarking and profiling tools fill this void. They create the framework on which your ability to identify problems and compare various solutions depends. Any reader who has been on a team scrambling to figure out why a certain application or web page is not performing correctly understands just how painful not having this framework in place can be.
Yes, setting up a framework for benchmarking your applications takes time and effort. It's not something that just happens by flipping a switch. Likewise, effectively profiling an application requires the developer and administrator to take a proactive stance. Waiting for an application to experience problems is not professional, but, alas, is usually the status quo, even for large applications.
Above all, we want you to take from this chapter not only knowledge of how to establish benchmarks and a profiling system, but also a true understanding of the importance of each. In this chapter, we don't assume you have any knowledge of these topics. Why? Well, one reason is that most novice and intermediate books on MySQL don't cover them. Another reason is that the vast majority of programmers and administrators we've met over the years (including ourselves at various points) have resorted to the old trial-and-error method of identifying bottlenecks and comparing changes to application code.
To download the entire chapter in PDF format, click here » (no registration required!)