Lecture 05 - RDBMS
Lecture 05 - RDBMS
Computing
Lecture 5
Dan Amiga
[email protected]
Agenda
• Relational Database
• Replication
• Sharding
• Database as a Service
– AWS RDS
– SQL Azure
CAP Theorem
• Optimistic
– Assume multiple transactions can complete
without effecting each other
– No locking
– Each transaction verified no other transaction
modified it’s data, otherwise rollback
• Pessimistic
– Blocks resource; effects performance
Scaling RDBMS
Source:
Sharding
• Read Replicas
• Multi-Availability Zone
– Production excellence
– Synchronous replication (across AZ)
– Automatic failover, endpoint stays.
IOPS vs MBps
• Database as a service
• Not a full blown SQL Server
– e.g. SQLCLR, ServiceBroker
SQL Azure Database
Value Props:
Roll-‐your-‐own HA/DR/scale
Dedicated
On-‐premise
Resources
Value Props:
Hosted
Shared
Low “Friction”/Control High
SQL Azure Application Topologies
SQL Azure access from within MS Datacenter SQL Azure access from outside MS Datacenter
(Azure compute – ADO.NET) (On-‐premises – ADO.NET)
Application/
Browser App Code
/ Tools
App Code
(ASP.NET)
Windows Azure
T-‐SQL (TDS)
T-‐SQL (TDS)
Root
• Federation Federation “CustData”
– Represents the data being partitioned (Federation Key: CustID)
• Federation Key
– The value that determines the routing of a piece of data Member: PK [min, 100)
• Atomic Unit AU AU AU
PK=5 PK=25 PK=35
– All rows with the same federation key value: always together!
• Federation Member (aka Shard)
– A physical container for a range of atomic units Member: PK [100, 488)
• Federation Root AU AU AU
– The database that houses federation directory PK=105 PK=235 PK=365
AU AU AU
PK=555 PK=2545 PK=3565
Distribution of Data: Concepts
• Partitioned
– Spread across member machines
– Each piece is on one machine (+HA)
– Most of the data!
• Centralized Config