SlideShare a Scribd company logo
1 of 16
How not to Model Data
Amar Shrestha
Senior Software Engineer
What is Data Modeling
Data modeling is the process of creating a visual representation of either a whole information
system or parts of it to communicate connections between data points and structures
Gurzu Confidential
3
The goal is to illustrate the types of data used and stored within the system, the relationships among these
data types, the ways the data can be grouped and organized and its formats and attributes.
Student
PK StudentID CHAR(9)
FirstName VARCHAR(30)
LastName VARCHAR(30)
Car
PK VIN CHAR(20)
LicensePlate VARCHAR(30)
Make VARCHAR(20)
Model VARCHAR(20)
Color VARCHAR(15)
FK StudentID CHAR(9)
ParkingSticker
PK SticketID CHAR(9)
LotNumber VARCHAR(30)
FK VIN CHAR(20)
FK StudentID CHAR(9)
Owns/Owned by
Assigned/Assigned to
Assigned/Assigned to
Mindset while modeling data
Generally when modeling data, the first thing
that comes to mind is How to store data.
But is this how data modeling should be
done? What would be your ideal approach?
Gurzu Confidential
Based on past experiences, the most important thing in
my opinion would be fetching the stored data
Normalize or not to Normalize?
Gurzu Confidential
Normalization is the process of structuring data in accordance with rules called normal
forms to reduce data redundancy and data integrity.
Normalization
Gurzu Confidential
Denormalization is a process to improve the read performance of a database at the expense
of losing some write performance by adding redundant data or by grouping data.
Denormalization
Gurzu Confidential
The choice on using normalization or denormalization depends on the requirements of
the project/application we are building
Normalization Vs Denormalization
Use of Indexes & Constraints
Indexes
An Index is a set of ordered references
to rows of a table, its main purpose is
to improve performance of data
retrieval by reducing the number of
physical pages that the database must
access to read a row.
Constraints
Constraints are rules that the database
enforces to improve data integrity.The types of
constraints are:
1. NOT NULL Constraint
2. UNIQUE Constraint
3. DEFAULT Constraint
4. CHECK Constraint
5. KEY Constraint
Gurzu Confidential
● Pick correct columns for indexing as wrong index may slow down queries rather than speeding it
up
● Composite Index may speed up some queries as well as slow down some. Find the correct order
of columns
● Heavy use of constraints may slow down insert and update operations
● Foreign key and Foreign key constraints are different.Use constraints when needed
What to Avoid?
Indexes and Constraints
Where to Compromise?
As we have seen in the previous topics there are always choices in we
have to make while data modeling. Along with choices there come
compromises
Gurzu Confidential
Compromise with Data Integrity to increase Performance
Or
Compromise with Performance for Data Integrity
Gurzu Confidential

More Related Content

What's hot (7)

Expanding on obs
Expanding on obsExpanding on obs
Expanding on obs
 
Data Modeling Basics
Data Modeling BasicsData Modeling Basics
Data Modeling Basics
 
Dbs213: MS ACCESS
Dbs213: MS ACCESSDbs213: MS ACCESS
Dbs213: MS ACCESS
 
Normalization
NormalizationNormalization
Normalization
 
Design approach
Design approachDesign approach
Design approach
 
Dbms 9: Relational Model
Dbms 9: Relational ModelDbms 9: Relational Model
Dbms 9: Relational Model
 
Eight common but false objections to the discontinuation of significance test...
Eight common but false objections to the discontinuation of significance test...Eight common but false objections to the discontinuation of significance test...
Eight common but false objections to the discontinuation of significance test...
 

Similar to How not to Model Data

1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...
1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...
1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...
JOHNLEAK1
 
1RUNNING HEAD Normalization2NormalizationNORM.docx
1RUNNING HEAD Normalization2NormalizationNORM.docx1RUNNING HEAD Normalization2NormalizationNORM.docx
1RUNNING HEAD Normalization2NormalizationNORM.docx
drennanmicah
 

Similar to How not to Model Data (20)

RDBMS Denormalization - Benefits & Pitfalls
RDBMS Denormalization - Benefits & PitfallsRDBMS Denormalization - Benefits & Pitfalls
RDBMS Denormalization - Benefits & Pitfalls
 
Databse management system
Databse management systemDatabse management system
Databse management system
 
Exploratory Data Analysis - A Comprehensive Guide to EDA.pdf
Exploratory Data Analysis - A Comprehensive Guide to EDA.pdfExploratory Data Analysis - A Comprehensive Guide to EDA.pdf
Exploratory Data Analysis - A Comprehensive Guide to EDA.pdf
 
Exploratory Data Analysis - A Comprehensive Guide to EDA.pdf
Exploratory Data Analysis - A Comprehensive Guide to EDA.pdfExploratory Data Analysis - A Comprehensive Guide to EDA.pdf
Exploratory Data Analysis - A Comprehensive Guide to EDA.pdf
 
Exploratory Data Analysis - A Comprehensive Guide to EDA.pdf
Exploratory Data Analysis - A Comprehensive Guide to EDA.pdfExploratory Data Analysis - A Comprehensive Guide to EDA.pdf
Exploratory Data Analysis - A Comprehensive Guide to EDA.pdf
 
Data models
Data modelsData models
Data models
 
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
 
1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...
1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...
1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...
 
Data modeling 101 - Basics - Software Domain
Data modeling 101 - Basics - Software DomainData modeling 101 - Basics - Software Domain
Data modeling 101 - Basics - Software Domain
 
Sql good practices
Sql good practicesSql good practices
Sql good practices
 
Data Warehousing AWS 12345
Data Warehousing AWS 12345Data Warehousing AWS 12345
Data Warehousing AWS 12345
 
1RUNNING HEAD Normalization2NormalizationNORM.docx
1RUNNING HEAD Normalization2NormalizationNORM.docx1RUNNING HEAD Normalization2NormalizationNORM.docx
1RUNNING HEAD Normalization2NormalizationNORM.docx
 
BIAM 410 Final Paper - Beyond the Buzzwords: Big Data, Machine Learning, What...
BIAM 410 Final Paper - Beyond the Buzzwords: Big Data, Machine Learning, What...BIAM 410 Final Paper - Beyond the Buzzwords: Big Data, Machine Learning, What...
BIAM 410 Final Paper - Beyond the Buzzwords: Big Data, Machine Learning, What...
 
International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES) International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)
 
Vision Based Deep Web data Extraction on Nested Query Result Records
Vision Based Deep Web data Extraction on Nested Query Result RecordsVision Based Deep Web data Extraction on Nested Query Result Records
Vision Based Deep Web data Extraction on Nested Query Result Records
 
Data Warehouse ( Dw Of Dwh )
Data Warehouse ( Dw Of Dwh )Data Warehouse ( Dw Of Dwh )
Data Warehouse ( Dw Of Dwh )
 
A ROBUST APPROACH FOR DATA CLEANING USED BY DECISION TREE
A ROBUST APPROACH FOR DATA CLEANING USED BY DECISION TREEA ROBUST APPROACH FOR DATA CLEANING USED BY DECISION TREE
A ROBUST APPROACH FOR DATA CLEANING USED BY DECISION TREE
 
Methods for analysis and design of an information system.pdf
Methods for analysis and design of an information system.pdfMethods for analysis and design of an information system.pdf
Methods for analysis and design of an information system.pdf
 
Machine Learning: A Fast Review
Machine Learning: A Fast ReviewMachine Learning: A Fast Review
Machine Learning: A Fast Review
 
Database Systems - introduction
Database Systems - introductionDatabase Systems - introduction
Database Systems - introduction
 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 

How not to Model Data

  • 1. How not to Model Data Amar Shrestha Senior Software Engineer
  • 2. What is Data Modeling Data modeling is the process of creating a visual representation of either a whole information system or parts of it to communicate connections between data points and structures
  • 3. Gurzu Confidential 3 The goal is to illustrate the types of data used and stored within the system, the relationships among these data types, the ways the data can be grouped and organized and its formats and attributes. Student PK StudentID CHAR(9) FirstName VARCHAR(30) LastName VARCHAR(30) Car PK VIN CHAR(20) LicensePlate VARCHAR(30) Make VARCHAR(20) Model VARCHAR(20) Color VARCHAR(15) FK StudentID CHAR(9) ParkingSticker PK SticketID CHAR(9) LotNumber VARCHAR(30) FK VIN CHAR(20) FK StudentID CHAR(9) Owns/Owned by Assigned/Assigned to Assigned/Assigned to
  • 4. Mindset while modeling data Generally when modeling data, the first thing that comes to mind is How to store data. But is this how data modeling should be done? What would be your ideal approach?
  • 5. Gurzu Confidential Based on past experiences, the most important thing in my opinion would be fetching the stored data
  • 6. Normalize or not to Normalize?
  • 7. Gurzu Confidential Normalization is the process of structuring data in accordance with rules called normal forms to reduce data redundancy and data integrity. Normalization
  • 8. Gurzu Confidential Denormalization is a process to improve the read performance of a database at the expense of losing some write performance by adding redundant data or by grouping data. Denormalization
  • 9. Gurzu Confidential The choice on using normalization or denormalization depends on the requirements of the project/application we are building Normalization Vs Denormalization
  • 10. Use of Indexes & Constraints
  • 11. Indexes An Index is a set of ordered references to rows of a table, its main purpose is to improve performance of data retrieval by reducing the number of physical pages that the database must access to read a row.
  • 12. Constraints Constraints are rules that the database enforces to improve data integrity.The types of constraints are: 1. NOT NULL Constraint 2. UNIQUE Constraint 3. DEFAULT Constraint 4. CHECK Constraint 5. KEY Constraint
  • 13. Gurzu Confidential ● Pick correct columns for indexing as wrong index may slow down queries rather than speeding it up ● Composite Index may speed up some queries as well as slow down some. Find the correct order of columns ● Heavy use of constraints may slow down insert and update operations ● Foreign key and Foreign key constraints are different.Use constraints when needed What to Avoid? Indexes and Constraints
  • 14. Where to Compromise? As we have seen in the previous topics there are always choices in we have to make while data modeling. Along with choices there come compromises
  • 15. Gurzu Confidential Compromise with Data Integrity to increase Performance Or Compromise with Performance for Data Integrity