Professional Documents
Culture Documents
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
Queries simple transactions & frequent updates complex, aggregate queries & limited updates
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
1 https://commons.wikimedia.org/wiki/File:Flower_jtca001.jpg 2
https://commons.wikimedia.org/wiki/File:Languages_xml.png 3
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 https://en.wikipedia.org/wiki/Data_model
DATABASE DESIGN
Conceptual - ER diagram Logical - schema
Entities, relationships, and attributes Fastest conversion: entities become the tables
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 attributes
What is being analyzed?
Does not change as often
How often do entities change?
DATABASE DESIGN
Let's practice!
D ATA B A S E D E S I G N