The Developer vs. The Relational Database: How to do it right
-
Upload
gogula-aryalingam -
Category
Technology
-
view
166 -
download
0
description
Transcript of The Developer vs. The Relational Database: How to do it right
The Developer
The Relational Database
vs
HOW TO DO IT
RIGHT!
#DevDaySL @gogula
About me
MVP:SQL Server
MCSE:Business Intelligence
Author:Chapter 57
Technical Architect
Gogula Aryalingam
6
2011
#DevDaySL @gogula
Agenda
Defensive Programming
Do it right:
Best Practices
Database Design
Documenting
Indexing considerations
Utility objects
#DevDaySL @gogula
What’s wrong with this picture
#DevDaySL @gogula
Here’s what…
Keys/Uniqueness
Data TypesNormalizatio
nNaming Convention
Constraints
#DevDaySL @gogula
A better design
#DevDaySL @gogula
Database design
Code is
Agile Database
is brittl
e
#DevDaySL @gogula
Programming defensively
2. Modularize into fully testable and fully tested code
1. Define & understand assumptions
4. Reuse code when feasible*
3. Test as many use cases as possible
#DevDaySL @gogula
Indexing for performance
Unique, narrow, static field
A clustered index on a heap (table) is a good idea
Leave small tables as is
Non-clustered indexes on fields used inJOINs and WHERE predicates
Do not index every field Index based on usage
Consider filtered indexesConsider included indexes
#DevDaySL @gogula
Use utility objects
The Numbers table, for set based:
String sorting Extraction of distinct characters
Generate time ranges or time slices
Find IDENTITY gaps
Even something trivial like generating an IP range
#DevDaySL @gogula
Document your code
Document through code
Document the Why apart
from the What
#DevDaySL @gogula
Do we have time for a demo?
Defensive database
programming
#DevDaySL @gogula
Questions?
During the
break
#DevDaySL @gogula
THANK YOU
#DevDaySL @gogula
MVP:SQL Server
dbantics.wordpress.comwww.sqlserveruniverse.com
Gogula AryalingamTechnical Architect
@gogula
lk.linkedin.com/in/gogula
Contact