3 days ago · Tech · 0 comments

These are my notes from the first few chapters of Refactoring Databases by Scott Ambler and Pramod Sadalage. The book was published in 2006 and its examples are a bit outdated, but the underlying ideas translate well to modern Rails applications where migrations serve as the primary mechanism for schema evolution. A follow-up post will cover additional database refactoring techniques from the later chapters. Refactoring Databases Many of the techniques in this book apply to large production databases with critical or sensitive data, heavy traffic, and zero tolerance for downtime. If you're working on a small app with a handful of users and can afford a maintenance window, a lot of this can be simplified. But the patterns are worth knowing for when you're operating at a scale where you can't just stop the world, run a migration, and hope for the best.The case for database refactoringMost Rails developers are comfortable refactoring application code. Extract a method, rename a class,…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.