Physical Database Design Data Migration/Conversion
What is physical DB design? The organization of the internal data model to strike a balance between performance and usability. a.k.a “When to De-Normalize”
Factors which Impact Physical Design Structure – table and relationship count Volume – quantity of data Volatility – rate of change of data Input Mode – how does data gets in Storage Format – data type selection Retrieval – optimizing data retrieval
Structure
Volume Volume determines DBMS selection. Right-size your DBMS.
Volatility The more volatile your data, the more hardware resources should be dedicated to it. DBMS Selection should also play a factor.
Input Mode High input modes need simplified table designs and more hardware resources.
Storage Format Right-sized column data types. Int vs. varchar Date vs. varchar Accuracy vs. performance – (Defaults, check constraints )
Retrieval Index – a thread over columns in a table which speed up searches over it. Cluster – physically grouping rows of data in the same physical block on disk. Improving search at the expense of insert/update
Indexing Rule of Thumb Use Indexes The table contains over 100,000 rows The searchable field (indexed column) has a wide range of values The searchable field has a large number of null values The searchable field is queried frequently Queries retrieve less than 2% - 4% of the table’s rows Avoid Indexes There are relatively few rows in the table The column is not used for searching The majority of the queries that retrieve more than 2% - 4% of the table’s rows There is high insert or update transaction volatility CREATE [UNIQUE] [NONCLUSTERED] INDEX index_name ON table_name (column_name [ASC|DESC][,…n])
Data Migration / Conversion
What is Data Migration / Conversion? Data Migration – the act of moving data from one system to another Data Conversion – the act of moving data from one format to another. Typically as part of upgrading systems you need to do both.
Common Types In Place – all activities done on the one DMBS – Eg. Upgrade wordpress from 3.0 to Parallel – Both system running at the same time, with final cut-over. – Eg. Upgrade from Blackboard 8 to 9 Phased – parts of the system are migrated in phases. (Accompanies in-place or parallel)
The Process ExtractionCleansingTransformationLoadingVerification
SQL Example Case study example using this: