Start reading Refactoring Databases: Evolutionary Database Design on your Kindle in under a minute. Don't have a Kindle? Get your Kindle here or start reading now with a free Kindle Reading App.

Deliver to your Kindle or other device

 
 
 

Try it free

Sample the beginning of this book for free

Deliver to your Kindle or other device

Anybody can read Kindle books—even without a Kindle device—with the FREE Kindle app for smartphones, tablets and computers.
Refactoring Databases: Evolutionary Database Design (Addison-Wesley Signature Series)
 
 

Refactoring Databases: Evolutionary Database Design (Addison-Wesley Signature Series) [Kindle Edition]

Scott W. Ambler , Pramod J. Sadalage
3.8 out of 5 stars  See all reviews (4 customer reviews)

Print List Price: £31.99
Kindle Price: £27.80 includes VAT* & free wireless delivery via Amazon Whispernet
You Save: £4.19 (13%)
* Unlike print books, digital books are subject to VAT.

Formats

Amazon Price New from Used from
Kindle Edition £27.80  
Hardcover £40.99  
Paperback £31.99  
Kindle Daily Deal
Kindle Daily Deal: At least 60% off
Each day we unveil a new book deal at a specially discounted price--for that day only. Learn more about the Kindle Daily Deal or sign up for the Kindle Daily Deal Newsletter to receive free e-mail notifications about each day's deal.


Product Description

Product Description

Refactoring has proven its value in a wide range of development projects–helping software professionals improve system designs, maintainability, extensibility, and performance. Now, for the first time, leading agile methodologist Scott Ambler and renowned consultant Pramodkumar Sadalage introduce powerful refactoring techniques specifically designed for database systems.

 

Ambler and Sadalage demonstrate how small changes to table structures, data, stored procedures, and triggers can significantly enhance virtually any database design–without changing semantics. You’ll learn how to evolve database schemas in step with source code–and become far more effective in projects relying on iterative, agile methodologies.

 

This comprehensive guide and reference helps you overcome the practical obstacles to refactoring real-world databases by covering every fundamental concept underlying database refactoring. Using start-to-finish examples, the authors walk you through refactoring simple standalone database applications as well as sophisticated multi-application scenarios. You’ll master every task involved in refactoring database schemas, and discover best practices for deploying refactorings in even the most complex production environments.

 

The second half of this book systematically covers five major categories of database refactorings. You’ll learn how to use refactoring to enhance database structure, data quality, and referential integrity; and how to refactor both architectures and methods. This book provides an extensive set of examples built with Oracle and Java and easily adaptable for other languages, such as C#, C++, or VB.NET, and other databases, such as DB2, SQL Server, MySQL, and Sybase.

 

Using this book’s techniques and examples, you can reduce waste, rework, risk, and cost–and build database systems capable of evolving smoothly, far into the future.

From the Back Cover

Refactoring has proven its value in a wide range of development projects, helping software professionals improve system designs, maintainability, extensibility, and performance. Now, for the first time, leading agile methodologist Scott Ambler and renowned consultant Pramodkumar Sadalage introduce powerful refactoring techniques specifically designed for database systems.

Ambler and Sadalage demonstrate how small changes to table structures, data, stored procedures, and triggers can significantly enhance virtually any database design -- without changing semantics. You’ll learn how to evolve database schemas in step with source code -- and become far more effective in projects relying on iterative, agile methodologies.

This comprehensive guide and reference covers every fundamental concept underlying database refactoring, and helps you overcome the practical obstacles to refactoring real-world databases. Start-to-finish examples walk you through refactoring both simple standalone database applications and sophisticated multi-application scenarios. You’ll master every task involved in refactoring database schemas, and discover best practices for deploying refactorings in even the most complex production environments.

The second half of this book systematically covers five major categories of database refactorings. You’ll learn how to use refactoring to enhance database structure, data quality, and referential integrity; and how to refactor both architectures and methods. The book provides an extensive set of examples, built with Oracle and Java, and easily adaptable for other languages, such as C#, C++, or VB.NET.

Using this book’s techniques and examples, you can reduce waste, rework, risk, and cost -- and build database systems capable of evolving smoothly, far into the future.


Product details

  • Format: Kindle Edition
  • File Size: 4363 KB
  • Print Length: 384 pages
  • Simultaneous Device Usage: Up to 5 simultaneous devices, per publisher limits
  • Publisher: Addison-Wesley Professional; 1 edition (3 Mar 2006)
  • Sold by: Amazon Media EU S.à r.l.
  • Language: English
  • ASIN: B001QAP36E
  • Text-to-Speech: Enabled
  • X-Ray:
  • Average Customer Review: 3.8 out of 5 stars  See all reviews (4 customer reviews)
  • Amazon Bestsellers Rank: #405,591 Paid in Kindle Store (See Top 100 Paid in Kindle Store)
  •  Would you like to give feedback on images?


More About the Authors

Discover books, learn about writers, and more.

Customer Reviews

3.8 out of 5 stars
3.8 out of 5 stars
Most Helpful Customer Reviews
9 of 9 people found the following review helpful
4.0 out of 5 stars A book which states the obvious 14 Dec 2007
Format:Hardcover
I disagree with the first reviewer of this book. I think the reason for that is what he focused on.

"Refactoring" by Martin Fowler suffers from the same problem. The value in this book does not lie in the refactorings themselves. The value lies in the 100+ pages at the front of the book where the process and environment needed to refactor databases is described.

After having read these few chapters, a lot of people I have talked to are left with a feeling of having read a lot of ideas that should have been obvious from the word go. Yet, not a single one of them were able to come up with these ideas by themselves. That is where the real value of this book lies. This is not a blueprint book which teaches you how to go about refactoring database schemas. This book teaches how to remove the obstacles that make such refactorings impossible.

I think books which state the obvious ideas people don't seem able to dream up by themselves are the most valuable. Therefore I think this book warrants four stars.
Comment | 
Was this review helpful to you?
2 of 2 people found the following review helpful
5.0 out of 5 stars Brings Data into the 21st Century 13 Jun 2008
Format:Hardcover
This is an excellent book! If you are from the Data world, please read this to see what can be done to make databases more flexible and resilent in the face of change. If you are a software developer, read and absorb the lessons, then leave this on your favourite DBA's desk for them to read too.

The book starts with a quick summary, useful if you only have a chance to skim this at first read. Then the authors describe how the patterns latter on in the book can and should be used. Another aspect I like is the way that typical objections are discussed and dealt with, as well as being realistic about potential problems. The rest of the book is made up of various patterns for database refactoring. There is good emphasis on the use of tests and testing to keep your data and application intact while you refactor.

You are going to get practical advice and guidance here which makes it worth the time to read this book. The writing style is easy to follow and gets to the point quickly and effectively.

Get this book, and absorb and apply the contents - you will never look at a data design, or a database in quite the same way again.
Comment | 
Was this review helpful to you?
5 of 8 people found the following review helpful
2.0 out of 5 stars Disappointing 29 Mar 2007
Format:Hardcover|Verified Purchase
I bought this book hoping it would help answer some specific design problems I have at work. From the reviews at the US amazon site I expected this to be quite good.

I found that most of the refactorings were fairly obvious and didn't really warrant being put in a book.

There is still a gap in the market that this book tried to fill, so hopefully someone will step in.
Was this review helpful to you?
0 of 1 people found the following review helpful
4.0 out of 5 stars For the most part a useful reference book 19 Nov 2012
Format:Paperback|Verified Purchase
This is not a book to be read from cover to cover. It is for the most part a reference book. I've been a DBA for 30 years and for the last 15 developed agile methods for continuous integration in multi-application single data model environments. Finding this book has confirmed some of the paradigms that experience has taught me. I would like to congratulate the authors for finding the time to document them. Personally I would have prefered more detail in the first part of the book. (It is stretching things a bit to say "the second half" since the split is roughly 20-80 bewteen describing databases in an agile environment and the refactoring patterns.) So in this respect I was a little disappointed.

The book could do with revising. For example the "Rename Table" refactoring covers only two options: "create table newname as select * from oldname" with database triggers to enforce data integrity between the tables; or "alter table oldname rename to newname" and an updateable view "create view oldname as select * from newname". Why not rename the table and create a synonym "create synonym oldname for newname"? Much simpler and works for Oracle, DB2, Sybase, SQL Server and PostgreSQL, but not mySQL unfortunately.

Overall I would recommend this book not only to DBAs, but to developers who will get an appreciation of the difficulties faced by DBAs in an agile world.
Comment | 
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 4.4 out of 5 stars  24 reviews
40 of 45 people found the following review helpful
5.0 out of 5 stars Excellent refactoring reference and eye-opening book 8 May 2006
By Michael Cohn - Published on Amazon.com
Format:Hardcover
This is an excellent book that, in my opinion, serves two purposes. First, it is a compendium of well thought-out ways to evolve a database design. Each refactoring includes descriptions of why you might make this change, tradeoffs to consider before making it, how to update the schema, how to migrate the data, and how applications that access the data will need to change. Some of the refactorings are simple ones that even the most change-resistant DBAs will have used in the past ("Add index"). Most others (such as "Merge tables" or "Replace LOB with Table") are ones many conventional thinking DBAs avoid, even to the detriment of the applications their databases support.

This brings me to the second purpose of this book. Many DBAs view their jobs as protectors of the data. While that is admirable, they sometimes forget that they are part of a software development team whose job is to provide value to the organization through the development of new (and enhancement of existing) applications. One of the best DBAs I ever worked with viewed himself as a "Data Valet." He said his job was to make sure the data was presented to applications when and where they wanted and to protect the doors from getting dinged while under his care. Through its first five chapters and then the refactorings that follow, this book will help DBAs expand their view of their role in the organization from one of simply protecting data to one of enhancing the value of data to the organization.

This book is one that you'll keep on your reference shelf for many years to come. Highly recommended.
15 of 15 people found the following review helpful
4.0 out of 5 stars Some important ideas but much work remains to be done 16 Aug 2008
By P. Cherryl - Published on Amazon.com
Format:Hardcover|Verified Purchase
In software development a 'refactoring' is a change that improves code quality without changing functionality. Refactoring helps keep an application maintainable over its life-cycle as requirements evolve, and is particularly of interest to those adopting modern 'agile' methodologies. This book comprises five general chapters on database refactoring - about 70 pages - followed by a 200 page catalog of various refactorings. The refactorings are classified as 'structural', 'data quality', 'referential integrity', 'architectural' and 'methods'. An additional chapter catalogs 'transformations', more on which in a moment. Each catalog entry uses a template including 'Motivation', 'Tradeoffs', 'Schema Update Mechanics', 'Data-Migration Mechanics' and 'Access Program Update Mechanics'. The 'Mechanics' sections include example code fragments for Oracle, JDBC and Hibernate.

Several of the structural refactorings are just simple database schema changes: rename/drop column/table/view. Adding is not really a refactoring so add column/table/view were cataloged as 'transformations' - changes that do affect the application, a distinction that appears to me a little clumsy. Some structural refactorings are more interesting: merge/split columns/tables, move column, introduce/remove surrogate key, introduce calculated column, introduce associative table.

The data quality refactorings include introduce/drop default values, null or check constraints, standardize codes, formats and data types, use consistent keys and lookup tables. Most of these are common best practices, seeing them cataloged as refactorings didn't yield me any new insights. Only replacing type codes with flags was of special interest.

Referential integrity refactorings include the obvious add/drop foreign keys with optional cascading delete, but also using triggers to create a change history and hard vs. soft deletes. Using before and after delete triggers to implement soft deletes is probably the best example in the book.

Architectural refactorings include using CRUD methods (ie. stored procedures or functions to select/insert/update/delete records), query functions that return cursor refs, interchanging methods and views, implementing methods in stored procedures, using materialized views and using local mirror tables vs. remote 'official' data sources. All these are common design techniques and the discussion of motivation and tradeoffs is particularly relevant.

The final section on method refactorings is more abbreviated and covers typical code refactorings. These qualify for inclusion only because databases include stored procedures, but they have nothing to do with schema evolution.

An important aspect of this book is that the catalog of refactorings is presented in the context of evolutionary database development described in the first five chapters: this approach emphasises an iterative approach, automated regression testing, configuration control of schema objects and easy availability of personalized application database environments for developers. Refactorings and transformations are intended to be applied one by one, and an automated regression test suite used to maintain confidence that a change does not introduce an application defect. Change control and a change tracking mechanism are essential to manage the application of schema changes to integration, QA and production environments.

What do I like about this book? The catalog of refactorings is thorough (some might say pedantic) which makes it a good learning tool for new database developers and DBAs, and as a shared reference for communicating on larger projects and in larger organizations. Experienced DBAs working on smaller projects are less likely to find it useful.

What don't I like? Relatively little is provided about the tools required to make regular refactoring practical, the authors simply state that these are being worked on. utPLSQL is not mentioned at all. The discussion on tracking changes is thin (but check out the LiquiBase project on Sourceforge). No guidance is provided on how you might use Ant to build and maintain developer database environments. Little is covered on the tough topic of building and maintaining test data sets. A final pet peeve: no discussion of refactoring across multiple schemas shared by an application suite.

In summary this book sketches out some important ideas but much work remains to be done. The catalog takes a number of established techniques and best practices and places them in a new framework which at least provides value to some for now.
18 of 21 people found the following review helpful
3.0 out of 5 stars on the right path 17 Nov 2006
By arzewski - Published on Amazon.com
Format:Hardcover
This book is a much needed exploration on the subject. It tries to categorize those operations that developers and DBAs do on a database, who, for various reasons, must address a specific problem, need. I only gave it three stars because it is somewhat insufficient. It also doesn't make much of a distinction between a database in development and one in production. In the latter case, it is really difficult to make changes when there is already a data structure in place with data, being updated constantly by users, and plans to migrate to a different data model while a system is in production is really not for the faint of heart. What I am really loooking for is a thick book of bad designs that, for various reasons (unclear or evolving requirements, political), a database model presents itself with a bunch of problems, real problems and not just theoretical, and the ways a DBA and developers came about after a big pow-wow on how to solve it.
9 of 10 people found the following review helpful
5.0 out of 5 stars Finally! 6 April 2006
By Base Aware - Published on Amazon.com
Format:Hardcover
It's been almost 7 years since Fowler's Refactoring book, and now the database community has finally caught up with the rest of us. This book shows how to refactor a relational database schema, working you through the detailed process steps for doing so and providing the source code for implementing more database refactorings than I would have thought existed.

The first five chapters describe how to go about database refactoring. Chapter 1 overviews the idea that you can evolve your database schema in small steps, a radical departure for many traditional DBAs. It also overviews the need for supporting techniques such as agile data modeling, database regression testing, and version control of your data models and scripts. I would have liked to see more coverage of these topics, but at least the modeling material is covered in Ambler's Agile Modeling book and there are some great SCM books out there.

Chapters 2 and 3 walk through the process of implementing a database refactoring, first through the simple situation where there is only a handful of applications accessing the database. I guess this sort of thing happens in smaller companies, but most of the time you really have to worry about scores of applications accessing your database which is a much harder situation. This is actually the focus of Chapter 3 and of the presented solutions in Chapters 6 through 11 which provide reference implementations for all of the database refactorings. This approach belies the true strength of the book: it reflects actual experience in large organizations, not just the theoretical pie in the sky stuff you see from other authors.

Chapter 4 focuses on deploying database refactorings in production, providing detailed instructions for how to roll refactorings between various sandboxes. It importantly describes how to merge the refactorings of several teams together. If you have 100 applications accessing a shared database, then potentially you need to manage the refactorings coming from 100 different development teams. Of course it would never be that bad, but even merging refactorings from 10 teams would be tough. This might be where the technique falls apart because many companies likely don't have data managers who are skilled enough to do this sort of thing efficiently enough to keep up with agile developers. We need new tools, so hopefully companies like Oracle will build something for us.

Chapter 5 describes a collection of best practices and challenges pertaining to refactoring databases. The authors share their experiences as well as identify potential issues, such as a lack of tooling and agile expertise within the data community, that could slow adoption of this technique. My guess is that the smarter teams within companies will start doing this stuff right away, for the most part it's pretty easy technically, but that bigger companies will struggle to change as they always do.

Chapters 6+ are reference descriptions for the individual refactorings. Each one is described using a UML data model, which is a little strange at first although once you get used to it you can see how it's a much better notation than Crow's feet, a detailed text description and source code. The source code examples are detailed, I guess the authors want to be thorough and provide a complete solution so that there's no question how to implement each refactoring. The application examples are written in Java or Hibernate, but they're simple enough that you could see how to implement them in C#, C++, Ruby, or even VB. The database code is Oracle, once again it's pretty straightforward so you can easily see how it would work in other DBs like Sybase or MySQL.

All in all, if you're a DBA or agile programmer you need to seriously think about buying this book.
4 of 4 people found the following review helpful
3.0 out of 5 stars Refactoring (Relational) Databases 12 Jun 2008
By Eric Jain - Published on Amazon.com
Format:Hardcover
The bulk of this book is a catalog of database "refactorings" such as "rename table" or "add column constraint". Each refactoring includes a brief description and the steps you'd go through. There is often also some stored procedure code, with the odd JDBC code or Hibernate configuration fragment. This is all interesting, but a bit tedious to read through from A to Z, so it's best used as a checklist when doing a change (though it's usually nothing surprising).

The more interesting part of the book talks about how to manage and evolve a database in general (e.g. keep a table that tracks all changes that have been applied). But this part doesn't go quite as far as I'd hoped it would, e.g. there is no discussion of how to track down who is using what parts of the database prior to refactoring (proxy driver? access stats?), and the discussion is limited to relational databases (which may not even be the best choice for rapidly evolving data models).

btw there is an interesting open source tool called LiquiBase (apparently inspired by this book) that attempts to help manage (and deploy) database "refactorings" as described in this book.
Were these reviews helpful?   Let us know
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 

Search Customer Discussions
Search all Amazon discussions
   


Look for similar items by category