Book Review: The Definitive Guide to SQLite
Reviewed by Cameron Laird
The Definitive Guide to SQLite
By Mike Owens
SQLite is important, and more important than you realize.
Those are two different claims; I feel safe making both of them. The SQLite relational database management system (RDBMS) really is extraordinary in several ways, which I can only begin to describe. It's on most computers, but it's so quiet, trouble-free, and small that you might well not be aware of it. PHP5 relies on it. It's built into many telephones, MP3 players, medical information systems, industrial controllers, and who knows what else.
I mean that last literally. Not even SQLite's author, D. Richard Hipp, is sure where all SQLite has gone or will go, but it keeps turning up in surprising places (avionics? automotive packages?). Part of the reason I describe it as "extraordinary" above, is that it's achieved all this since 2000, when Hipp began coding. Since then, he and the few other SQLite contributors have not only finished three distinct versions while keeping their "day jobs", but they've done so with such high quality that commercial behemoths including Apple, General Electric, and Nokia entrust "mission-critical" data to SQLite.
Think about this for a moment. In an information economy, data are the most substantial assets, exactly the stuff most in need of being protected and secured to the highest standards. An expanding roster of organizations has chosen SQLite to store data they can't afford to lose. It's not enough that SQLite is available at no cost, or typically benchmarks higher than twice the speed of MySQL or Oracle. In less than six years, SQLite has achieved a reputation for absolute reliability that exceeds that accorded to Microsoft, Oracle, or IBM for their flagship DMBS products, all of which date back to the '80s.
What other hot software technologies do you know? Ruby? AJAX? Virtualization? Streaming video? All began by the mid-'90s, at the latest. It simply takes a while for even the best ideas to get far in such a large industry.
SQLite must be a very good idea.
The next step
It's time to learn more about SQLite. How do you do so? With The Definitive Guide to SQLite. True, if your interest in persistence technologies is casual, you can well read the home-page documentation, various magazine introductions, the one book published in 2004 on SQLite, or even sample popular opinion as recorded in Usenet newsgroups and Web forums. In this case, though, just as SQLite has clearly put distance between itself and its competitors, The Definitive Guide to SQLite also provides unusual value:
- The book is "fresh". It only started to ship to booksellers in June 2006; the "Foreword" Hipp wrote for it is dated in early April; and the contents are fully current with the latest in version 3 of SQLite as of winter 2005-2006;
- The book is easy to take. Read for yourself its summary table of contents; while it's a thoroughly generic and character-less outline of any software technology, it is the correct organization to serve as both an introduction and reference. An Appendix is the proper place for "Codd's 12 Rules", there's good interplay between concepts and code, the nine main chapter topics make so much sense one will quickly have them memorized, and so on. Even better, the physical book follows "Contents at a Glance" with a detailed, eight-page "Contents" that makes it easy to locate everything for which I searched in The Definitive Guide to SQLite. The Index also is correct and useful, as near as I've been able to verify.
- Author Michael Owens writes well and accurately. His book is better than I would have done, frankly; while I'm a fan and frequent user of SQLite and thought briefly a couple of times of assembling a team to do the subject justice, I'm relieved I didn't. Owens crafts his lively prose so it's easy to understand what he needs to get across about even such challenging subjects as the relational calculus or scoping of user-defined functions. As the author of pysqlite, he certainly understands SQLite deeply, but also broadly, for he correctly covers what SQLite means for such other languages as C, Java, Perl, PHP, Ruby, and Tcl. He's rigorous in explaining such matters as that the storage pager is inaccessible to the API, but that a full understanding of transaction behavior requires study of that same pager.
- The physical book is hardbound, and appears to be stitched well. While I have had it in my hands only a brief time, it opens conveniently, "lays flat", and I hope and expect it'll last a long time. An eBook version also is available.
Is there anything The Definitive Guide to SQLite lacks? I wish Hipp's "Foreword" were on the Web. That Owens explained SQL without explicit mention of ACIDity was a mild surprise. There are slight ambiguities in explanations of related software; Owens sometimes doesn't distinguish between, for example, a binary and a source installation. That's all, though. I have no complaints more serious than these.
Let's review, then: while SQLite isn't the only lightweight data-management engine worth considering — at Phaseit, we use at least two competitors for specific projects — its use has exploded recently, and deserves to grow even more. For a reasonable price, you can have on your desk a book that lives up to its title as the definitive guide to the software.
Whether you buy a copy for yourself or not, it's worth the 15 minutes it might take to read its first chapter, freely available online. Even if you never use SQLite yourself, this "Introduction" will help you better understand the key concepts and trade-offs of persistence technology; you'll have a clearer vision of the places of DB2 and Sleepycat and the others.
Cameron is vice president of the Phaseit, Inc., consultancy, specializing in high-reliability and high-performance applications managed by high-level languages. He spent more than a decade heading development teams at database companies, and relies on at least six different DBMSs for current projects. He has reviewed more than 50 books for UnixReview.com, including the recent SQL in a Nutshell.