Advanced Active Record ebook available now

29 Dec 2017

I've finished my ebook! You can buy Advanced Active Record on leanpub for $20. You can also see the table of contents and some helpful Active Record-related links and whatnot on the book's site.

Really the subtitle is more accurate - "A Collection of Practical Deep Dives into Active Record Topics". Or maybe that could have been "Things That I Think You as a Fellow Experienced Active Record Developer Will Find Interesting". At any rate, the book has a bunch of things that I've run into over years of working on various Rails apps, and writing it gave me an excuse to dig into some of those.

Writing this ebook has given me even more respect for the Rails core team and especially folks who are maintaining and improving Active Record. They are working on a system that has a zillion users and, maybe more significantly, a zillion different usage profiles in terms of data shape and volume. Some Active Record users have department-level apps with ten tables and a thousand hits a day, others have apps that are slightly larger. To keep it all working and moving forward is a massive effort. I've heard Sean Griffin mention on The Bike Shed how some of the larger Active Record refactorings take months of solid, painstaking work to complete and I can see why. I can also understand why he says that this sort of thing is almost impossible to do just by dropping in an hour or two here and there on nights and weekends.

There were quite a few other topics that I would have liked to cover in the book. I've got a whole list of these: database-related Rake tasks, transaction and callback gotchas, interesting ways that gems monkeypatch and extend Active Record, accepts_nested_attributes_for, more SQL-to-Arel examples, more details on CTEs, and so on. I wanted to go ahead and get the book out there, but, since it's an ebook, there's always the possibility of adding a bit more.

I hope people learn as much from reading this book as I did from writing it. Enjoy!