Ware House Solutions

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 18 February 2013

Refactoring Legacy Databases

Posted on 13:06 by Unknown
  • Know your enemy - It might not always seem so, but legacy code was written with a process in mind. Determining what the code was originally designed to do it the most import step toward improving it
  • Small bites - How do you eat an elephant. One bite at a time. Choose process to refactor rather than diving straight into an unstructured rewrite
  • Retire old processes - If the process is obsolete, kill it off
  • Start with the end in mind - Work with the system stakeholders to agree the projects goals
  • Set standards. Old code can be in conflict with your current coding standards. (You do have defined coding standards don't you?). A clean code approach will make the job refactoring your code easier when the days comes that your code is itself recfactored.
  • Stop digging - Don't let developers submit code which contains lazy hardcoding or other bad practices.
  • Engage - Talk to your developers. Explain what constitutes good practice. Educate them.
  • Process - If you've got developers adding poor quality code to your database put a code review process in place. (You do have a code review process don't you?)
  • Permissions - Often developers who've worked with a system for years feel they know it so well they can jump on the box and commit a code change. This is how spaghetti code begins. If the softly, softly approach doesn't work revoke the developers permissions to commit change to your database.
  • Evolve - Your unlikely to get executive sign-off on a project to go an clean up existing code especially in a hectic environment. So take a medium term view. Tackle the worse code first and keep steady pressure on to continually improve coding standards.
  • Test-driven refactoring - Changes you make to a legacy system often have to produce the same result otherwise you've just broken a live application. So using tests is vital to ensure the quality of the refactoring process just as TDD is a mainstay of modern application development.

Check out these links for useful resources;

RedGate to the rescue once again with their excellent toolset here and advice on how to use it here. I specifically like the ability to format code, auto-generate aliases, encapsulate code in stored procedures and qualify object names. This tool saves so much time.

http://databaserefactoring.com/ - Lot's of good specific advice here.

http://www.amazon.com/dp/0321293533/ - A good reference
Read More
Posted in OLTP, Refactoring, T-SQL | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • SQL Bad Practice - Hardcoding
    Legacy systems present design challenges different to problems faced during greenfield development. One mistake I've seen time and again...
  • Data Warehousing Resources List
    Listed here are the best resources I've found for learning about data warehousing, useful techniques and methodologies. In no particular...
  • Big Data in the Real World - Part 2 of 2
    Part 1 of this series described the first 2 stages in the processing of clickstream data to allow sales conversion analysis. This post desc...
  • A 7-Zip Archiving Task for my SSIS Package Template
    I use an SSIS package template to speed up project delivery. 7-zip is my archiving tool of choice because it provides encryption and passwor...
  • Book Review - The Checklist Manifesto
    Periodically you read books which change your habits and make you more effective. The Checklist Manifesto is one such book. Authors who can ...
  • Pragmatic Principals - Agile
    The Data Warehouse exists to provide Business Intelligence. Its users will not always start with the end in mind. They will browse, discover...
  • Big Data in the Real World - Part 1 of 2
    There is so much talk of Big Data nowadays, mostly from sales people but also from technologists. Karen Lopez aka DataChick took issue at ...
  • Refactoring Legacy Databases
    Know your enemy - It might not always seem so, but legacy code was written with a process in mind. Determining what the code was originally ...
  • Building an Auditing Process for SSIS - Part 1
    An audit schema published in the excellent book SSIS Problem– Design – Solution allows the efficient capture of SSIS progress and errors in...
  • Pragmatic Principals - Focus
    The DW is a business system not a techie playground. Use Business Analyst's to focus all development on revenue generating (or saving) w...

Categories

  • 7-Zip
  • Architecture
  • Auditing
  • Bad Practice
  • Big Data
  • Book Review
  • Collations
  • Data Cleansing
  • Data Profiling
  • Data Warehouse
  • DBA
  • Design
  • Disaster Recovery
  • Error Handling
  • ETL
  • OLTP
  • Package Template
  • Principals
  • Professional Skills
  • Project Management
  • Quote
  • Refactoring
  • Replication
  • Resources
  • sFTP
  • SQL Agent
  • SSIS
  • T-SQL
  • WinSCP

Blog Archive

  • ▼  2013 (8)
    • ►  September (1)
    • ►  July (1)
    • ►  May (2)
    • ►  March (2)
    • ▼  February (1)
      • Refactoring Legacy Databases
    • ►  January (1)
  • ►  2012 (15)
    • ►  December (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (3)
    • ►  June (2)
    • ►  April (1)
    • ►  March (2)
    • ►  February (3)
    • ►  January (1)
Powered by Blogger.

About Me

Unknown
View my complete profile