Writings

New book: Structuring Databases For Apps

August 10, 2020

I recently completed a goal of mine I've had for many years now: I wrote a book.

A lot of what I do here is "write for my past self," and this book is no different. This is the book I wish I had when I first started programming almost eight years ago now.

Eight years ago I was copying and pasting database migrations from the Rails docs meanwhile having no idea what they were actually doing. What does "has and belong to many" even mean anyways?

Back then I would copy/paste the code and when the eventual errors arose I had no idea how to fix it—how could I? I didn't understand the underlying fundamentals how to structure data and data relationships.

So, this book is focused on the database tables, structures, and SQL queries to build any application you want. Whether you're modeling users and posts, actors and movies, bank transactions, selfies, or more, there's only a few practical structures you need to know to fulfill 99% of all production use cases.

It's not difficult information, and it doesn't have to be—the information itself isn't.

Here's the table of contents:

  • Intro - Why is this important?
  • Setup & Installation
  • Introduction to Databases and SQL (skippable if you already know it)
  • One to One ("Belongs to")
  • Many to Many ("Has and belongs to many")
  • Polymorphic (and its pitfalls)
  • Self Join
  • JSON Columns
  • Indexes
  • Data Cleanup
  • Conclusion

As a backend developer or database administrator you will use this information every day, and even frontend developers who understand this information will be better frontend devs and teammates.

The book is for sale on Gumroad, and it comes with supplemental SQL query files to setup your database and work alongside the book and through the examples in each chapter. Screencasts of each chapter are also available if you prefer to watch rather than read.

Also, if for any reason you're not satisfied with your purchase or it wasn't what you were expecting, there's a 30-day no questions asked 100% refund policy. Just reply to your download email. No questions asked.

John

TwitterGitHub