Database refactoring
   HOME

TheInfoList



OR:

A database refactoring is a simple change to a database schema that improves its design while retaining both its behavioral and informational semantics. Database refactoring does not change the way data is interpreted or used and does not fix bugs or add new functionality. Every refactoring to a database leaves the system in a working state, thus not causing maintenance lags, provided the meaningful data exists in the production environment. A database refactoring is conceptually more difficult than a
code refactoring In computer programming and software design, code refactoring is the process of restructuring existing computer code—changing the '' factoring''—without changing its external behavior. Refactoring is intended to improve the design, structur ...
; code refactorings only need to maintain behavioral semantics while database refactorings also must maintain informational semantics. A database schema is typically refactored for one of several reasons: # To develop the schema in an evolutionary manner in parallel with the evolutionary design of the rest of the system. # To fix design problems with an existing legacy database schema. Database refactorings are often motivated by the desire for
database normalization Database normalization or database normalisation (see spelling differences) is the process of structuring a relational database in accordance with a series of so-called normal forms in order to reduce data redundancy and improve data integrity ...
of an existing production database, typically to "clean up" the design of the database. # To implement what would be a large (and potentially risky) change as a series of small, low-risk changes.


Database refactorings

Examples of database refactoring: * Splitting an aggregate table into two different tables in the process of . * Renaming an existing column to make its purpose clearer. * Combining two columns into a single one because they were being used for the same purpose. * Splitting an existing column being used for multiple purposes into two or more columns that each have a single purpose. * Applying a common data format to a column so as to increase the consistency of the data. * Common code refactorings (Rename Method, Introduce Variable, Rename Variable, and so on) to database code such as stored procedures and triggers. * Introducing a view to implement a common access path to data.


Process of database refactoring

The process of database refactoring is the act of applying database refactorings to evolve an existing database schema (database refactoring is a core practice of evolutionary database design). There are three considerations that need to be taken into account: # How a single refactoring is implemented # How database refactorings are tracked and shared within organizations # How a series of database refactorings are applied


See also

*
Database testing Database testing usually consists of a layered process, including the user interface (UI) layer, the business layer, the data access layer and the database itself. The UI layer deals with the interface design of the database, while the business l ...
*
Data migration Data migration is the process of selecting, preparing, extracting, and transforming data and permanently transferring it from one computer storage system to another. Additionally, the validation of migrated data for completeness and the decommis ...
*
Denormalization Denormalization is a strategy used on a previously- normalized database to increase performance. In computing, denormalization is the process of trying to improve the read performance of a database, at the expense of losing some write performanc ...
*
Refactoring In computer programming and software design, code refactoring is the process of restructuring existing computer code—changing the '' factoring''—without changing its external behavior. Refactoring is intended to improve the design, structu ...
*
Test-driven development Test-driven development (TDD) is a software development process relying on software requirements being converted to test cases before software is fully developed, and tracking all software development by repeatedly testing the software against al ...
*
Unit testing In computer programming, unit testing is a software testing method by which individual units of source code—sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures&md ...


References


External links


Database Refactoring Website
by Pramod Sadalage {{Database Extreme programming Databases