SlideShare a Scribd company logo
Seven Deadly Sins
Seven Deadly Sins
of Database Design
                g
 Speaker: Solomon Waters
  Embarcadero Technologies
    b    d       h l i

  San Francisco SQL Server User Group
  San Francisco SQL Server User Group
               June 2010




     Mark Ginnebaugh, User Group Leader 
           mark@designmind.com
           mark@designmind com
Seven Deadly Sins of
    Database Design

    Solomon Waters
    Manager, Software Consulting
    Embarcadero Technologies
    solomon.waters@embarcadero.com




2
Common Mistakes
    Seven Deadly Sins of
    Designing Databases

    Solomon Waters
    Manager, Software Consulting
    Embarcadero Technologies
    solomon.waters@embarcadero.com




3
Agenda

    • Topic
     – Seven Deadly Sins Common Mistakes of Designing Databases


    • What we’ll learn
     –   Pitfalls of a poor database design
                       p                 g
     –   Basics of normalization
     –   How to communicate a database design effectively
     –   How to avoid some of the most common mistakes made when designing databases


    • Q&A




4
7 Deadly Sins Common Mistakes

    1. Poor or no documentation for database(s) in production
    2.
    2 Little or no normalization
    3. Not treating the data model like a living, breathing
       organism
    4. Improper storage of reference data
    5. Not using foreign keys, check constraints, and/or
       defaults in the database
    6. Not using domains and naming standards
    7. Not choosing and/or indexing keys properly




5
7 Deadly Sins Common Mistakes

    1. Poor or no documentation for database(s) in production

    • Problems
       – No central documentation of database structure(s)
       – Inaccurate documentation of database structure(s)
                                                         ( )
       – No documentation at all of database structure(s)

    • Ramifications
       – Developers, DBAs, architects, etc. are not on the same page
       – Inability to respond to change
       – No communication between developers, DBAs and architects

    • Solution
       – Start from the bottom-up, i.e. reverse engineer database(s) to build
         documentation
       – Validate models prior to publishing them
       – Use HTML reporting and Portal to communicate to users

6
7 Deadly Sins Common Mistakes

    2. Little or no normalization

    • Problems
       – Database denormalized unnecessarily (i.e. too much)
       – One large table has been built to store “everything”
                 g                                    y    g
       – Multiple values in one column or repeating values in a table

    • Ramifications
       – Performance may be better, but maintenance can become a nightmare and
         expensive
       – Lots of NULLs if specific columns don’t have values for specific rows
       – Unneeded application code needed to parse out specific values

    • Solution
       – Understand the basics of database normalization
       – Know when and how to normalize when needed
       – Industry models can help as a reference or templates

7
7 Deadly Sins Common Mistakes

    2. Little or no normalization (cont’d)

    • First Normal Form:
       – Eliminate duplicative columns and repeating values in columns

    • Second Normal Form:
       – Remove redundant data that apply to multiple columns

    • Third Normal Form:
       – Each column of a table should be dependent on the primary key




8
7 Deadly Sins Common Mistakes

Len Silverston UDM




 9
7 Deadly Sins Common Mistakes

     3. Not treating the data model like a living, breathing
          g
        organism

     • Problems
        – Modeling is done upfront then never updated once the database changes
        – Design is not completed/reviewed for flaws before moving to production
        – Changes made in production/database without updating data model

     • Ramifications
        – Implementing changes becomes problematic and expensive
        – Undocumented data can lead to security and regulatory issues
        – Design missing functionality that the business needs
              g        g             y

     • Solution
        – Plan out the design of the database conceptually, logically and physically
        – Review the design with both technical AND non-technical stake holders
                                                    non technical
        – Update the models as changes occur or better yet, update the model first!

10
7 Deadly Sins Common Mistakes
3. Not treating the data model like a living, breathing organism
   (cont’d)

• Uncontrolled Changes
      – Models become out-of-date and no one uses
        them
      – Reports from out-of-date models are useless
      – No understanding what has changed




 11
7 Deadly Sins Common Mistakes
3. Not treating the data model like a living, breathing
   organism (cont’d)

• Controlled Change
      – Define a means of communicating
        changes
      – Don't let models get out of date
      – Build a process to update models
      – Automate the process
      – Ultimately drive changes from the
        model
      – Define a means of archiving/tracking
        changes




 12
7 Deadly Sins Common Mistakes

     4. Improper storage of reference data

     • Problems
        – Reference data (codes, lists, valid values) stored in more than one place
        – Reference data stored in application, not in the database
                                     pp
        – Constraints not placed in the database

     • Ramifications
        – More work is needed when code values change
        – Database can’t enforce consistency and accuracy of values
        – Problems when data is sourced from another place

     • Solution
        – Leverage data models to store data values
        – Keep them up to date with the database




13
7 Deadly Sins Common Mistakes

     5. Not using foreign keys, check constraints, and/or
        defaults in the database

     • Problems
        – Legacy system with check constraints and foreign keys enforce by application
        – Inconsistent data because lack of constraints
        – Using NULLs instead of defaults

     • Ramifications
        – Incredibly difficult to document system for other users
        – Special code becomes the norm, not the exception
        – Poor data quality can result if standards are not followed
                     q      y

     • Solution
        – If it can be enforced in the DDL at creation time do it
        – Use tools to infer relationships


14
7 Deadly Sins Common Mistakes

     6. Not using domains and naming standards

     • Problems
        – The “same” columns defined with different data types in different tables
        – The “same” column named differently in different tables
                                              y
        – Cryptic or non-descriptive names that don’t identify the use of a column

     • Ramifications
        – Inconsistent and/or poor data quality
        – Confusion and wasted time for future developers, DBAs, architects, etc
        – Inaccurate use of column

     • Solution
        – Define a common list of domains users can leverage
        – Have a common naming standard dictionary to abbreviate logical to/from
          physical names



15
7 Deadly Sins Common Mistakes

     7. Not choosing and/or indexing keys properly

     • Problems
        – Using surrogate keys that don’t uniquely identify the data
        – Poorly choosing a p
               y         g primary key (
                                   y y (too many columns, column is updated frequently)
                                                  y                  p         q     y)
        – Not indexing foreign keys

     • Ramifications
        – Each row is unique but not the data which leads to redundant data
        – Updating or changing primary keys is not trivial
        – Performance issues when updating data or accessing related data often

     • Solution
        – Use a combination of natural and surrogate keys where applicable
        – Follow the SUM rules when choosing PKs: 1. Static 2. Unique 3. Minimal
          Columns
        – Use model validation wizard to enforce rules

16
About the Speaker

     • Solomon Waters
      – Manager, Software Consulting
      – solomon.waters@embarcadero.com


     • Resources
      –   COMPANY: http://www.embarcadero.com
      –   BLOG: http://datamodel.wordpress.com
      –   PRODUCT INFO: http://www.embarcadero.com/products/er-studio
      –   DOWNLOAD: https://downloads.embarcadero.com/free/er_studio




17
Thank you!




18
To learn more or inquire about speaking opportunities, please contact:

                             g            p
                Mark Ginnebaugh, User Group Leader
                      mark@designmind.com

More Related Content

What's hot (19)

PPT
requirements analysis and design
Preeti Mishra
 
DOC
Non functional requirements framework
wweinmeyer79
 
PDF
Requirement analysis and UML modelling in Software engineering
snehalkulkarni74
 
PPTX
Introduction
Preeti Mishra
 
PPT
Software design, software engineering
Rupesh Vaishnav
 
PDF
OOAD - System Analysis and Design
Murugeswari Ravi
 
PPT
Chapter1 conventional softwaremanagement (1)
Jkumararaja
 
PPT
Software Project Management lecture 7
Syed Muhammad Hammad
 
PPT
Lect3
Sulman Ahmed
 
PPTX
Chapter 04
andyburghardt
 
PPT
eUnit 2 software process model
Preeti Mishra
 
PPTX
Introduction To Software Concepts Unit 1 & 2
Raj vardhan
 
DOC
Sr. Teradata DBA
Trudy Thompson
 
PPTX
Software development planning and essentials
Rajesh P
 
PPTX
Software Requirement Specification
Niraj Kumar
 
DOC
Gururajan_new
Gururajan Venkataraman
 
PPT
Introduction to Software Engineering SE1
koolkampus
 
PPT
Software requirements engineering
Abdul Basit
 
requirements analysis and design
Preeti Mishra
 
Non functional requirements framework
wweinmeyer79
 
Requirement analysis and UML modelling in Software engineering
snehalkulkarni74
 
Introduction
Preeti Mishra
 
Software design, software engineering
Rupesh Vaishnav
 
OOAD - System Analysis and Design
Murugeswari Ravi
 
Chapter1 conventional softwaremanagement (1)
Jkumararaja
 
Software Project Management lecture 7
Syed Muhammad Hammad
 
Chapter 04
andyburghardt
 
eUnit 2 software process model
Preeti Mishra
 
Introduction To Software Concepts Unit 1 & 2
Raj vardhan
 
Sr. Teradata DBA
Trudy Thompson
 
Software development planning and essentials
Rajesh P
 
Software Requirement Specification
Niraj Kumar
 
Gururajan_new
Gururajan Venkataraman
 
Introduction to Software Engineering SE1
koolkampus
 
Software requirements engineering
Abdul Basit
 

Viewers also liked (8)

PDF
ER/Studio Data Architect Datasheet
Embarcadero Technologies
 
PPTX
Database Introduction by Luke Lonergan
Luke Lonergan
 
PDF
MDM Mistakes & How to Avoid Them!
Alan Lee White
 
PPTX
Logical DB Design (OOP)
Traitet Thepbandansuk
 
PDF
ER Diagrams Simplified
Puneet Arora
 
PDF
Assignment 1 of Database (MySQL & Sqlite3)
Aey Unthika
 
PPT
2. Entity Relationship Model in DBMS
koolkampus
 
PPTX
GENERATIONS OF COMPUTER
Rajat More
 
ER/Studio Data Architect Datasheet
Embarcadero Technologies
 
Database Introduction by Luke Lonergan
Luke Lonergan
 
MDM Mistakes & How to Avoid Them!
Alan Lee White
 
Logical DB Design (OOP)
Traitet Thepbandansuk
 
ER Diagrams Simplified
Puneet Arora
 
Assignment 1 of Database (MySQL & Sqlite3)
Aey Unthika
 
2. Entity Relationship Model in DBMS
koolkampus
 
GENERATIONS OF COMPUTER
Rajat More
 
Ad

Similar to Microsoft SQL Server Seven Deadly Sins of Database Design (20)

PDF
5 physical data modeling blunders 09092010
ERwin Modeling
 
DOCX
Discussion 1 The incorrect implementation of databases ou
huttenangela
 
PDF
10 things to avoid in data model 09242010
ERwin Modeling
 
PPTX
Data Quality as a Business Success Factor
Boris Otto
 
ODP
Data quality overview
Alex Meadows
 
PPTX
Sql server infernals
Gianluca Sartori
 
DOCX
Write a scholarly post on the following topic and reply given 4 po.docx
arnoldmeredith47041
 
PPT
Getting Unstuck: Working with Legacy Code and Data
Cory Foy
 
PPTX
Karen Lopez 10 Physical Data Modeling Blunders
Karen Lopez
 
PDF
Data model scorecard article 2 of 11
Analytics8
 
PDF
What Is Data Quality.pdf
scottsamith
 
PDF
Gaining Competitive Advantage Through Risk Data Governance
Infosys
 
PPT
overview of database concept
gourav kottawar
 
PPT
Crack Smoking Data Models
newmedio
 
PDF
CodeCritics Applied to Database Schema: Challenges and First Results
Julien Delplanque
 
PDF
What Does Big Data Mean and Who Will Win
BigDataCloud
 
PDF
Runaway complexity in Big Data... and a plan to stop it
nathanmarz
 
PPT
demo2.ppt
crazyvirtue
 
PPTX
Data architecture principles to accelerate your data strategy
CloverDX
 
5 physical data modeling blunders 09092010
ERwin Modeling
 
Discussion 1 The incorrect implementation of databases ou
huttenangela
 
10 things to avoid in data model 09242010
ERwin Modeling
 
Data Quality as a Business Success Factor
Boris Otto
 
Data quality overview
Alex Meadows
 
Sql server infernals
Gianluca Sartori
 
Write a scholarly post on the following topic and reply given 4 po.docx
arnoldmeredith47041
 
Getting Unstuck: Working with Legacy Code and Data
Cory Foy
 
Karen Lopez 10 Physical Data Modeling Blunders
Karen Lopez
 
Data model scorecard article 2 of 11
Analytics8
 
What Is Data Quality.pdf
scottsamith
 
Gaining Competitive Advantage Through Risk Data Governance
Infosys
 
overview of database concept
gourav kottawar
 
Crack Smoking Data Models
newmedio
 
CodeCritics Applied to Database Schema: Challenges and First Results
Julien Delplanque
 
What Does Big Data Mean and Who Will Win
BigDataCloud
 
Runaway complexity in Big Data... and a plan to stop it
nathanmarz
 
demo2.ppt
crazyvirtue
 
Data architecture principles to accelerate your data strategy
CloverDX
 
Ad

More from Mark Ginnebaugh (20)

PDF
Automating Microsoft Power BI Creations 2015
Mark Ginnebaugh
 
PDF
Microsoft SQL Server Analysis Services (SSAS) - A Practical Introduction
Mark Ginnebaugh
 
PDF
Platfora - An Analytics Sandbox In A World Of Big Data
Mark Ginnebaugh
 
PDF
Microsoft SQL Server Relational Databases and Primary Keys
Mark Ginnebaugh
 
PDF
DesignMind Microsoft Business Intelligence SQL Server
Mark Ginnebaugh
 
PDF
San Francisco Bay Area SQL Server July 2013 meetings
Mark Ginnebaugh
 
PDF
Silicon Valley SQL Server User Group June 2013
Mark Ginnebaugh
 
PDF
Microsoft SQL Server Continuous Integration
Mark Ginnebaugh
 
PDF
Hortonworks Big Data & Hadoop
Mark Ginnebaugh
 
PDF
Microsoft SQL Server Physical Join Operators
Mark Ginnebaugh
 
PDF
Microsoft Data Warehouse Business Intelligence Lifecycle - The Kimball Approach
Mark Ginnebaugh
 
PDF
Fusion-io Memory Flash for Microsoft SQL Server 2012
Mark Ginnebaugh
 
PDF
Microsoft Data Mining 2012
Mark Ginnebaugh
 
PDF
Microsoft SQL Server PASS News August 2012
Mark Ginnebaugh
 
PDF
Business Intelligence Dashboard Design Best Practices
Mark Ginnebaugh
 
PDF
Microsoft Mobile Business Intelligence
Mark Ginnebaugh
 
PDF
Microsoft SQL Server 2012 Cloud Ready
Mark Ginnebaugh
 
PDF
Microsoft SQL Server 2012 Master Data Services
Mark Ginnebaugh
 
PDF
Microsoft SQL Server PowerPivot
Mark Ginnebaugh
 
PDF
Microsoft SQL Server Testing Frameworks
Mark Ginnebaugh
 
Automating Microsoft Power BI Creations 2015
Mark Ginnebaugh
 
Microsoft SQL Server Analysis Services (SSAS) - A Practical Introduction
Mark Ginnebaugh
 
Platfora - An Analytics Sandbox In A World Of Big Data
Mark Ginnebaugh
 
Microsoft SQL Server Relational Databases and Primary Keys
Mark Ginnebaugh
 
DesignMind Microsoft Business Intelligence SQL Server
Mark Ginnebaugh
 
San Francisco Bay Area SQL Server July 2013 meetings
Mark Ginnebaugh
 
Silicon Valley SQL Server User Group June 2013
Mark Ginnebaugh
 
Microsoft SQL Server Continuous Integration
Mark Ginnebaugh
 
Hortonworks Big Data & Hadoop
Mark Ginnebaugh
 
Microsoft SQL Server Physical Join Operators
Mark Ginnebaugh
 
Microsoft Data Warehouse Business Intelligence Lifecycle - The Kimball Approach
Mark Ginnebaugh
 
Fusion-io Memory Flash for Microsoft SQL Server 2012
Mark Ginnebaugh
 
Microsoft Data Mining 2012
Mark Ginnebaugh
 
Microsoft SQL Server PASS News August 2012
Mark Ginnebaugh
 
Business Intelligence Dashboard Design Best Practices
Mark Ginnebaugh
 
Microsoft Mobile Business Intelligence
Mark Ginnebaugh
 
Microsoft SQL Server 2012 Cloud Ready
Mark Ginnebaugh
 
Microsoft SQL Server 2012 Master Data Services
Mark Ginnebaugh
 
Microsoft SQL Server PowerPivot
Mark Ginnebaugh
 
Microsoft SQL Server Testing Frameworks
Mark Ginnebaugh
 

Recently uploaded (20)

PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Python basic programing language for automation
DanialHabibi2
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 

Microsoft SQL Server Seven Deadly Sins of Database Design

  • 1. Seven Deadly Sins Seven Deadly Sins of Database Design g Speaker: Solomon Waters Embarcadero Technologies b d h l i San Francisco SQL Server User Group San Francisco SQL Server User Group June 2010 Mark Ginnebaugh, User Group Leader  [email protected] mark@designmind com
  • 2. Seven Deadly Sins of Database Design Solomon Waters Manager, Software Consulting Embarcadero Technologies [email protected] 2
  • 3. Common Mistakes Seven Deadly Sins of Designing Databases Solomon Waters Manager, Software Consulting Embarcadero Technologies [email protected] 3
  • 4. Agenda • Topic – Seven Deadly Sins Common Mistakes of Designing Databases • What we’ll learn – Pitfalls of a poor database design p g – Basics of normalization – How to communicate a database design effectively – How to avoid some of the most common mistakes made when designing databases • Q&A 4
  • 5. 7 Deadly Sins Common Mistakes 1. Poor or no documentation for database(s) in production 2. 2 Little or no normalization 3. Not treating the data model like a living, breathing organism 4. Improper storage of reference data 5. Not using foreign keys, check constraints, and/or defaults in the database 6. Not using domains and naming standards 7. Not choosing and/or indexing keys properly 5
  • 6. 7 Deadly Sins Common Mistakes 1. Poor or no documentation for database(s) in production • Problems – No central documentation of database structure(s) – Inaccurate documentation of database structure(s) ( ) – No documentation at all of database structure(s) • Ramifications – Developers, DBAs, architects, etc. are not on the same page – Inability to respond to change – No communication between developers, DBAs and architects • Solution – Start from the bottom-up, i.e. reverse engineer database(s) to build documentation – Validate models prior to publishing them – Use HTML reporting and Portal to communicate to users 6
  • 7. 7 Deadly Sins Common Mistakes 2. Little or no normalization • Problems – Database denormalized unnecessarily (i.e. too much) – One large table has been built to store “everything” g y g – Multiple values in one column or repeating values in a table • Ramifications – Performance may be better, but maintenance can become a nightmare and expensive – Lots of NULLs if specific columns don’t have values for specific rows – Unneeded application code needed to parse out specific values • Solution – Understand the basics of database normalization – Know when and how to normalize when needed – Industry models can help as a reference or templates 7
  • 8. 7 Deadly Sins Common Mistakes 2. Little or no normalization (cont’d) • First Normal Form: – Eliminate duplicative columns and repeating values in columns • Second Normal Form: – Remove redundant data that apply to multiple columns • Third Normal Form: – Each column of a table should be dependent on the primary key 8
  • 9. 7 Deadly Sins Common Mistakes Len Silverston UDM 9
  • 10. 7 Deadly Sins Common Mistakes 3. Not treating the data model like a living, breathing g organism • Problems – Modeling is done upfront then never updated once the database changes – Design is not completed/reviewed for flaws before moving to production – Changes made in production/database without updating data model • Ramifications – Implementing changes becomes problematic and expensive – Undocumented data can lead to security and regulatory issues – Design missing functionality that the business needs g g y • Solution – Plan out the design of the database conceptually, logically and physically – Review the design with both technical AND non-technical stake holders non technical – Update the models as changes occur or better yet, update the model first! 10
  • 11. 7 Deadly Sins Common Mistakes 3. Not treating the data model like a living, breathing organism (cont’d) • Uncontrolled Changes – Models become out-of-date and no one uses them – Reports from out-of-date models are useless – No understanding what has changed 11
  • 12. 7 Deadly Sins Common Mistakes 3. Not treating the data model like a living, breathing organism (cont’d) • Controlled Change – Define a means of communicating changes – Don't let models get out of date – Build a process to update models – Automate the process – Ultimately drive changes from the model – Define a means of archiving/tracking changes 12
  • 13. 7 Deadly Sins Common Mistakes 4. Improper storage of reference data • Problems – Reference data (codes, lists, valid values) stored in more than one place – Reference data stored in application, not in the database pp – Constraints not placed in the database • Ramifications – More work is needed when code values change – Database can’t enforce consistency and accuracy of values – Problems when data is sourced from another place • Solution – Leverage data models to store data values – Keep them up to date with the database 13
  • 14. 7 Deadly Sins Common Mistakes 5. Not using foreign keys, check constraints, and/or defaults in the database • Problems – Legacy system with check constraints and foreign keys enforce by application – Inconsistent data because lack of constraints – Using NULLs instead of defaults • Ramifications – Incredibly difficult to document system for other users – Special code becomes the norm, not the exception – Poor data quality can result if standards are not followed q y • Solution – If it can be enforced in the DDL at creation time do it – Use tools to infer relationships 14
  • 15. 7 Deadly Sins Common Mistakes 6. Not using domains and naming standards • Problems – The “same” columns defined with different data types in different tables – The “same” column named differently in different tables y – Cryptic or non-descriptive names that don’t identify the use of a column • Ramifications – Inconsistent and/or poor data quality – Confusion and wasted time for future developers, DBAs, architects, etc – Inaccurate use of column • Solution – Define a common list of domains users can leverage – Have a common naming standard dictionary to abbreviate logical to/from physical names 15
  • 16. 7 Deadly Sins Common Mistakes 7. Not choosing and/or indexing keys properly • Problems – Using surrogate keys that don’t uniquely identify the data – Poorly choosing a p y g primary key ( y y (too many columns, column is updated frequently) y p q y) – Not indexing foreign keys • Ramifications – Each row is unique but not the data which leads to redundant data – Updating or changing primary keys is not trivial – Performance issues when updating data or accessing related data often • Solution – Use a combination of natural and surrogate keys where applicable – Follow the SUM rules when choosing PKs: 1. Static 2. Unique 3. Minimal Columns – Use model validation wizard to enforce rules 16
  • 17. About the Speaker • Solomon Waters – Manager, Software Consulting – [email protected] • Resources – COMPANY: http://www.embarcadero.com – BLOG: http://datamodel.wordpress.com – PRODUCT INFO: http://www.embarcadero.com/products/er-studio – DOWNLOAD: https://downloads.embarcadero.com/free/er_studio 17