Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Pro MySQL 100

Rob Lanphier writes "I'm sure there are plenty of people like myself who do a fair amount of programming against MySQL databases, and consider it a feature of the product that it's pretty easy to do without having to fuss much with the actual database. Still, it's nice to look at what goes on under the hood, even if smoke isn't pouring out from beneath it. Pro MySQL by Michael Kruckenberg and Jay Pipes provides a broad well-organized exploration of intermediate and advanced MySQL topics that is a satisfying overview of the database management system." Read the rest of Rob's review.
Pro MySQL
author Michael Kruckenberg and Jay Pipes
pages 734
publisher Apress
rating 9
reviewer Rob Lanphier
ISBN 1-59059-505-X
summary MySQL overview for more advanced users


This book seems ideally suited for a couple of different audiences: Application developers with basic SQL knowledge hoping to gain a deeper understanding of the product and databases in general. The book provides a basic overview of the use of triggers, stored procedures, and cursors, among other things, before getting into the MySQL specifics. Experts in other database management systems (e.g. Oracle, Sybase) who want to apply their expertise to MySQL. The book provides a good tour of advanced MySQL functionality, and does a fair job of pointing out MySQL's shortcomings where they exist (which are much fewer in the 5.0 series). Such readers may be annoyed by the MySQL-centric views that surface from time-to-time, but all of the information should be there.

Pro MySQL is probably too advanced for someone just getting started with SQL databases in general. If you really haven't done much with SQL or relational databases at all, you should start elsewhere.

That said, there's a lot of information in here for beginners, and doesn't rush headlong into complicated discussions without at least a cursory explanation of the basics. For example, Chapter 2 has a nice review of many basic computer science concepts. Chapter 4 ("MySQL System Architecture") gives a light overview of the MySQL source code, highlighting a unique advantage of using open source. Though not the strongest chapter in the book, it includes an interesting section titled "A Typical Query Execution", which walks down the call stack explaining the source code for a typical SELECT statement. Readers might want to skip to this part of the chapter before reading the rest.

The real strengths of this book are in the chapters that deal with the database at a slightly higher level, which is most of the book. ACID compliance is covered in a thorough way, with many hands-on examples to ensure a solid understanding of the topic. The detailed discussion of the various storage engine types (focusing mostly on MyISAM and InnoDB, but touching on the others) is very useful in understanding MySQL's unique pluggable engine model, and how to leverage it. Chapters 9 through 13 provide great reference material for MySQL 5.0's advanced functionality, which includes information on stored procedures, functions, cursors, views and triggers. The final chapters (14 through 21) would stand alone as a separate book for administering a production MySQL database.

Chapter 8 ("SQL Scenarios") alone makes this book well worth the purchase price, providing recipes for solving some common problems with SQL. Some are rather simple, such as an optimization for using "OR" in "SELECT" statements in older versions of MySQL. Others are rather complicated and involved (but very useful), such as a nice way of storing hierarchical data in a table using the nested set model. The authors are careful to credit their source, Joe Celko's book Trees and Hierarchies in SQL for Smarties, for the latter. Hardcore SQL junkies may want to go straight to the source, but it's nice to see the material presented in a way that helps bring beginners up to an expert level.

The book's main shortcomings are in dealing with products that aren't downloaded off of mysql.com. MySQL's GUI tools get ample treatment (with copious screenshots, including a confirmation dialog) but the very popular phpMyAdmin tool is not mentioned anywhere. In discussing MySQL's lack of role-based access control, the authors write: "If you feel MySQL's normal user access and privilege verification system will not meet the needs of your organization, head over to [MySQL's MaxDB site] to check out how MaxDB implements its role-based system[...]", ignoring the elephant in the room, so to speak.

On a few occasions, the authors do veer into unsupported yet strongly worded assertions. For example, "This fact [that MyISAM is seemingly more efficient at storing data than InnoDB] should not be a factor in how you choose your storage engines..." (emphasis theirs). Without guidance on how much of a difference (10%? 500%? wildly unpredictable?) and a definition of the problem being solved, it's hard to say with such certainty whether or not this is a reasonable assertion. Also, "be conservative, especially when deciding on the length of character columns that will be frequently indexed", ignoring the tradeoffs that lead to the Y2K problem, for example. The advice given may be quite sound, but it's not presented in a way that convinces the reader that the authors have thought through all of the implications of their advice.

By and large, though, this is a very happy addition to my bookshelf. The organization is coherent and the chapters all have appropriate depth and have very useful information. I imagine I will refer back to this book often in building SQL applications, and I recommend it to anyone looking to boost their MySQL knowledge.


You can purchase Pro MySQL from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived. No new comments can be posted.

Pro MySQL

Comments Filter:
  • by rylin ( 688457 ) on Wednesday August 23, 2006 @05:06PM (#15965499)
    In production / general availability, it's not there.
    I believe it's in the 5.1 betas though.

    A lot of the talks at this year's UC related to the storage engine agnostic behavior (backups, FT).
  • by Anonymous Coward on Wednesday August 23, 2006 @06:05PM (#15965951)
    We recently had to implement a custom CRM system, and as would be expected we needed the services of an SQL database. One of our project leads actually had this book on his bookshelf, and the rest of us on the team took a chance to look over it during the process of selecting which database we'd use.

    What was best about this book is that it did cover fairly advanced topics. And that was helpful, as we could clearly see what features MySQL did not offer. Unfortunately for MySQL, it did not offer all of the features we wanted, and thus we instead went with PostgreSQL.

  • by mlwmohawk ( 801821 ) on Wednesday August 23, 2006 @06:07PM (#15965961)
    I'm so tired of hearing about MySQL. Every last improvement they make for it, is completely pointess as more advanced, and free, databases are so far ahead.

    If all you want to do is "select * from mytable where col='foo'" you are wasting your time.

    My bigest beef with MySQL isn't its limitations, but the people who learn these limitations and never realize a relational database and query language is SO POWERFUL.

    So, they get an order of magnitude more data than needed from MySQL, process it in some scripting language, take the reduced data set, make another query to get what they wanted. In a *real* database, you'ld just construct the query correctly.

    Every time I see a MySQL cconnection error on a web site, and you see them every day, I just think the designer is a moron.
  • by mlwmohawk ( 801821 ) on Wednesday August 23, 2006 @09:42PM (#15967000)
    Do you prefer Oracle or DB2 for your guestbook or forum? ;)

    What is the point of using MySQL? If cost is an issue, PostgreSQL is free. IMHO PostgreSQL is, by far, easier to use than is MySQL. PostgreSQL scales better and by providing extensive SQL support, allows for more efficient and faster queries than MySQL ever could.

    If you need a banking quality database, then use Oracle or D2

    If you have two or more servers, use PostgreSQL

    If you have one server, use SQLite or PostgreSQL

    MySQL is just a mediocre database generally and poor example of a SQL database specifically. The Free Software movement is about building the best software. MySQL is not even close.

  • by lkcl ( 517947 ) <lkcl@lkcl.net> on Thursday August 24, 2006 @05:03AM (#15968303) Homepage
    specifically, don't use it for 'comprehensive' projects, involving many programming teams and/or a hundred tables.
    don't even consider using MySQL 5 for at least another four years, for such projects, until it matures - and by that time, PostgreSQL, an already mature product that has had Views, Triggers etc. right from the start, will have had even more rigorous testing.

    see http://advogato.org/article/894.html [advogato.org] for details.

Work without a vision is slavery, Vision without work is a pipe dream, But vision with work is the hope of the world.

Working...