Académique Documents
Professionnel Documents
Culture Documents
Mike Hillyer
Mike Zinner
and
The MySQL Workbench Team
1
Who Are We?
Mike Hillyer
Former MySQL AB Technical Writer, GUI Tools
http://www.mikehillyer.com
Mike Zinner
Team Lead, Developer Tools
http://zinner.org
Alfredo Kojima
Senior Software Engineer, Developer Tools
Johannes Taxacher
QA Engineer, Developer Tools
2
Who Are You?
3
What is This Session About?
An introductory session for those new to both data
modeling and MySQL Workbench
Covers:
Designing a schema
Introduction to workbench
Designing a schema with WB
How to normalize a schema
Performance Optimizations
Advanced Workbench Usage
Q&A
Conclusion
4
Workbench Install
Go to http://dev.mysql.com/workbench/
UC09Workbench.php to download installer
5
Introducing MySQL Workbench
6
MySQL Workbench Goals
Productivity for MySQL Developers & DBAs
Save time when working with big schemata
Make it easy to visualize and tune schemata
7
MySQL Workbench Editions
MySQL Workbench OSS (Community Edition)
MySQL Workbench SE (Standard Edition)
$99/Developer/Year subscription
$2,500...$20,000/Company/Year for Unlimited sub.
8
MySQL Workbench Standard Edition
Commercial extension of OSS version
Added features:
Schema object privilege system
Schema validation plugins
Model reporting
Online printing
Reverse engineering
Synchronization (against live database connections)
9
Usage Walkthough
10
Exercise
11
Data Types
12
Normalize Your Schema
What is Normalization?
13
Benefits of Normalization
Decreased storage consumption.
Removed redundancy means less data.
Better/Faster(/Stronger) searches.
Less data to scan.
Easier searches on (previously) mixed data.
14
The Normal Forms
15
First Normal Form (1NF)
16
Second Normal Form (2NF)
Requires that all fields relate to an entire
composite key, not just parts. (The Whole Key)
17
Third Normal Form (3NF)
Requires that all fields depend directly on the primary
key, and not on other non-key fields.
(And Nothing But The Key)
18
Additional Normal Forms
http://en.wikipedia.org/wiki/Database_normalization
19
By Example: User Tracking
Table has no Primary Key.
Name is not atomic.
Table starts with all possible user
information in a single table.
Phone numbers and email addresses
are horizontally redundant.
Company, department, city, state, zip
are vertically redundant.
20
1NF Satisfied
21
2NF Satisfied
22
3NF Satisfied
23
Over-Normalization
24
De-Normalization
Start by normalizing, then watch your slow query logs
and run EXPLAIN.
25
Think Outside the Database
Consider whether the data in question needs to be
stored in the database at all
26
How to De-Normalize
Combine one-to-many relationships - there are
times when a single column should be added to the
“many” table to remove the need to have a join
27
Managing Schema Privileges
28
Maintaining Your Design
29
Document Your Schema
30
31
Using Advanced Features
http://forums.mysql.com/read.php?153,208229
http://dev.mysql.com/workbench//?p=190
32
The Future of WB: RoadMap
Coming up next:
Multi RDBMS support
Logical modeling
Advanced migration
33
Q&A
Any Questions?
34
Conclusion
Watch http://wb.mysql.com/
for news and developments
35