Skip to content
#Databases

Database Refactoring: Evolutionary Design (Refactoring Databases: Evolutionary Database Design)

#Databases #Data #Software #SoftwareArchitecture #Architecture

This book focuses on the evolution of databases. It's written in 2006 At the time, relational databases were the de facto standard and there were no alternatives. Therefore, the whole book is devoted to the evolution of approaches with a rigid data scheme. (schema on read)It actively discusses the use of triggers and stored procedures and does not include polyglot persistence. But the authors talk about writing tests, the process of deploying, sandboxes for developers and so on. I read this book for the first time ten years ago and it seemed relevant to me at the time. Now I have reread it and some things seem obvious, but some are still interesting:)

As far as the content of the book is concerned, it is 11 heads

  1. Evolutionary database development - here the authors introduce the concept of evolutionary development of databases and list techniques: database refactoring, evolutionary data modeling, database regression testing, configuration management of database artifacts, developer sandboxes
  2. Database refactoring In this chapter, the authors draw parallels between code refactoring and data schema refactoring, as well as classification of refactoring types, which are described in more detail in the chapters. 6-10. Database smells: multipurpose column, multipurpose table, redundant data, tables with too many columns, tables with too many rows, smart columns, fear of change
  3. The process of database refactoring Here the authors talk about the process of creating a new circuit, parallel to the existence of a new and old circuit, and then turning off the old one. In fact, this is a standard story with compatibility between versions. (forward and backward compatibility)
  4. Deploying to production A little bit about CI/CD for databases (Now this chapter seems obvious.)
  5. Database refactoring strategies How to approach migration from an organizational perspective Next, the authors go through the classes of refactoring, which they defined in the chapter. 2.
  6. Structural refactoring It deals with simple things, such as how to delete a column, a table, a view, merge columns, rename them, or, for example, move from one-to-many to many-to-many.
  7. Data quality refactoring Add or remove restrictions on nullable, enter a data format for a column, add or delete a default value, or move data 😍 Referential integrity refactoring How to add or remove constraints, add cascading deletion, implement hard or soft delete, make a story on triggers
  8. Architectural refactoring Do CRUD through procedures, add a method to read through procedures, add view, add indexes, replace the procedure with view or vice versa:)
  9. Method refactoring About refactoring triggers, procedures and everything that is now recommended to use to a minimum
  10. Transformation How to add a new column, new table, new view, update data

As a result, the book is a bit boring and obvious at the moment, but it can still be used as a guide to making some changes to relational databases.

P.S. This book is in the context of our Code of Architecture book club, where we will discuss the chapter on the evolution of data from the book Building Evolutionary Architecture on Monday. This chapter has a reference to this book, "Refactoring Databases," so I decided to update my recollections:)

#Databases #Data #Software #SoftwareArchitecture #Architecture