Concurrency, Locking and Isolation Levels: Deadlocks Explained | Database Course Ep 22
Joshua Moses | Cybertrace Foundation
0:00 / 0:00
Concurrency, Locking and Isolation Levels: Deadlocks Explained | Database Course Ep 22
13 просмотров · 2 нед. назад
Joshua Moses | Cybertrace Foundation
193 подписчика
13 просмотров · 2 нед. назад
What happens when two users update the same data at the same time? Without the right controls, one update quietly overwrites the other. This episode covers concurrency, locking, isolation levels, and deadlocks.
We start with the chaos of concurrency, including the lost update problem where two users read the same $5,000 balance and write conflicting results. Then we lock down the data with shared and exclusive locks at the database, table, block, and row levels. You'll learn the isolation spectrum from READ UNCOMMITTED to SERIALIZABLE and the anomalies each one allows: dirty reads, nonrepeatable reads, and phantoms. We explain deadlocks, where sessions wait on each other forever, and prevention schemes like wait-die and wound-wait. We finish with optimistic concurrency, which detects conflicts instead of blocking, and how to match locking and isolation to your workload.
What you'll learn:
The lost update problem
Shared vs exclusive locks and lock granularity
The four isolation levels
Dirty reads, nonrepeatable reads, and phantom reads
How deadlocks happen and how databases resolve them
Pessimistic vs optimistic concurrency
Chapters:
0:00 Introduction
0:22 Episode Overview
0:37 The Chaos of Concurrency
2:43 Locking Down the Data
4:07 The Isolation Spectrum: Correctness vs Performance
5:26 Deadlocks: The Endless Wait
6:58 Optimistic Concurrency: Detecting Conflicts
8:17 Fixing Concurrency: Matching Strictness
Cybersecurity Masterclass by Joshua Moses | CyberTrace Foundation. #Course Lab Guide:
https://github.com/joshuanmoses/Cyber...