SQL Antipatterns by Bill Karwin (book-review)
When working on a side projects alone we have to deal at one point with data storage, for me I tried many years to look the other way from SQL and just except that some things has to done in a way.
Bill Karwin author of SQL Antipatterns wrote this book with deep experience on most developers day to day task in mind.
Starting from a simple “bug” database structure he explained each Anti-Pattern and why should it be avoided.
The book is split into 25 Chapter each explaining an Anit-Pattern from defining the data structure of tables to setting up keys and constraints to optimize queries.
What I found really helpful is the examples of each as it was often really close to a developer daily tasks!
In many example I was able to relate to some situation I had in which I was executing quires in a wrong way just because I did not fully understand how the concept worked.
He also explains how to optimize our SQL queries weather by removing some data from the SELECT or applying indexes with many great tips along the read.
Also another great thing is how each chapter is broken into:
- A small story showing when an anti-pattern would show up.
- Objective to what is this chapter trying to fix.
- Anti-Pattern explanation as to understand where to fix.
- Real life ways to recognize that we may have the Anti-Pattern applied.
- Legitimate use case as it maybe have good enough reason that is has been applied for.
- Solution! ways to deal with it.
Having the cut of chapters really help grasp the hole concept.
Bill also goes through SQL injection and how does affect our application code with many ways to prevent and help secure our database much more.
The book is using PHP and MySQL for all of the examples while I myself not a big fan of PHP but it is rather easy to understand and convert it to preferred programming language.
Along the book at each chapter author starts with a famous quote that is relevant with the talking subject.
Whom this book is targeted to:
- Software developers who need a more in-depth in understanding SQL queries.
- Mid-Starter pack for database admin.
Would not recommend for advanced SQL developers.
You can download the book from here!
Have a good read!