6.5830 Lecture 1 (WIP)
What is a database
- collection of structured data
- organized as records + relationships between them
The modern cloud data architecture
- AWS Aurora (OLTP DBMS)
- OLTP - online transaction processing, and typically the ones you use to build applications
Presentation Tier <-> Logic Tier <-> Client Tier
Quiz 1
- Data modeling / layout
- Declarative querying
- Query processing
- Algorithms for accessing and manipulating data
Why should we care?
Real world impact
Concepts
Data modeling & layout
- Systematic approach to structuring / representing data
- Constistency, sharing, efficiency of access to persistent data
Declarative Querying and Query Processing
- Ask for data
- Compiler finds optimal plan
- Low-level techniques
Consistency / Transactions + Concurrency Control
Basically, ACID:
- Atomicity: Operations are all-or-nothing
- Consistency: Semantics are well-defined, invariants are respected
- Isolation: Concurrent transactions are isolated from each other
- Durability: 🤞 Hope our data doesn’t get lost
Example - Zoo
A zoo website might have:
- admin interface that allows adding and editing animals
- public interface for viewing pictures and maps
- zookeeper interface for finding hungry animals
1k animals, 5k URLs, 10 admins, 200 keepers
Zoo Data Model
Animal entity, Cage entity, Keeper entity
What info might we want to keep about an animal? Name, species, who is the keeper, which cage is it in, etc.?
Animals have names, ages, species Keepers have names Cages have feeding times, buildings Animals are in 1 cage; cages have multiple animals Keepers keep multiple cages, cages kept by multiple keepers
Our Zoo
- Mike the Moose
- Tim the Giraffe
- Sally the student
Operations
- move all snakes to new building
- need to change many files
- multiple admins editing page at the same time
- need concurrency control
- system may crash mid-update
- need all-or-nothing operations
- need to find animal that was fed the longest ago
- need efficient plan from database
Databases address all these issues and more
Date: August 27, 2024
Tags:
lecture