Chapter 1
Chapter 1
Chapter 1
D ATA B A S E D E S I G N
Lis Sulmont
Curriculum Manager
Our motivating question:
Access control: Should all users of the data have the same level of access
DBMS: How do I pick between all the SQL and noSQL options?
and more!
DATABASE DESIGN
Our motivating question:
Access control: Should all users of the data have the same level of access
DBMS: How do I pick between all the SQL and noSQL options?
and more!
DATABASE DESIGN
Approaches to processing data
OLTP OLAP
Online Transaction Processing Online Analytical Processing
DATABASE DESIGN
Some concrete examples
OLTP tasks OLAP tasks
Find the price of a book Calculate books with best pro t margin
DATABASE DESIGN
OLAP vs. OLTP
OLTP OLAP
Purpose support daily transactions report and analyze data
Design application-oriented subject-oriented
Data up-to-date, operational consolidated, historical
Size snapshot, gigabytes archive, terabytes
simple transactions & frequent complex, aggregate queries & limited
Queries
updates updates
Users thousands hundreds
DATABASE DESIGN
Working together
DATABASE DESIGN
Takeaways
Step back and gure out business requirements
DATABASE DESIGN
Let's practice!
D ATA B A S E D E S I G N
Storing data
D ATA B A S E D E S I G N
Lis Sulmont
Curriculum Manager
Structuring data
1. Structured data 2. Unstructured data
De ned data types & relationships Makes up most of data in the world
_e.g., SQL, tables in a relational database _ e.g., photos, chat logs, MP3
DATABASE DESIGN
Structuring data
1Flower by Sam Oth and Database Diagram by Nick Jenkins via Wikimedia Commons
h ps://commons.wikimedia.org/wiki/File:Languages_xml.png
DATABASE DESIGN
Storing data beyond traditional databases
Traditional databases
For storing real-time relational structured data ? OLTP
Data warehouses
For analyzing archived structured data ? OLAP
Data lakes
For storing data of all structures = exibility and scalability
DATABASE DESIGN
Data warehouses
Optimized for analytics - OLAP
Organized for reading/aggregating data
Usually read-only
Data marts
DATABASE DESIGN
Data lakes
Store all types of data at a lower cost:
e.g., raw, operational databases, IoT device logs, real-time, relational and non-relational
Run big data analytics using services such as Apache Spark and Hadoop
Useful for deep learning and data discovery because activities require so much data
DATABASE DESIGN
ETL
ELT
DATABASE DESIGN
Let's practice!
D ATA B A S E D E S I G N
Database design
D ATA B A S E D E S I G N
Lis Sulmont
Curriculum Manager
What is database design?
Determines how data is logically stored
How is data going to be read and updated?
DATABASE DESIGN
Data modeling
Process of creating a data model for the data to be stored
Tools: data structure diagrams, e.g., entity-relational diagrams and UML diagrams
Tools: database models and schemas, e.g., relational model and star schema
1 h ps://en.wikipedia.org/wiki/Data_model
DATABASE DESIGN
Conceptual - ER diagram Logical - schema
DATABASE DESIGN
Other database design options
Determining tables
DATABASE DESIGN
Beyond the relational model
Dimensional modeling
Adaptation of the relational model for data warehouse design
DATABASE DESIGN
Elements of dimensional modeling
Fact tables
Changes regularly
Dimension tables
Organize by:
Holds descriptions of a ributes
What is being analyzed?
Does not change as o en
How o en do entities change?
DATABASE DESIGN
Let's practice!
D ATA B A S E D E S I G N