From ea5a4dc641657a0236d4179420173b270636d999 Mon Sep 17 00:00:00 2001 From: boris Date: Tue, 6 Feb 2024 13:38:14 +0000 Subject: [PATCH] vault backup: 2024-02-06 13:38:14 --- .obsidian/workspace.json | 2 +- .../Week 4/Week 4 Database Systems.md | 30 ++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 9a28217..fdd64e3 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -155,7 +155,7 @@ } ], "direction": "horizontal", - "width": 300 + "width": 200 }, "left-ribbon": { "hiddenItems": { diff --git a/Semester 2/Database Systems/Week 4/Week 4 Database Systems.md b/Semester 2/Database Systems/Week 4/Week 4 Database Systems.md index 4e768b5..afb948e 100644 --- a/Semester 2/Database Systems/Week 4/Week 4 Database Systems.md +++ b/Semester 2/Database Systems/Week 4/Week 4 Database Systems.md @@ -1 +1,29 @@ -# \ No newline at end of file +# Concurrency Control + +Process of managing simultaneous operations on the database without interference. +Prevents interference when >2 users access and update the db + +# Lost Update Problem + +A successful update is overwritten by another user - a read operation of a tuple happens at the same time as a value update of the tuple. This causes the next value update to access the incorrect value, as the read value is incorrect too. +This would be avoided if any reads are prevented until all updates are completed. + +# Uncommitted Dependency Problem + +A transaction reads the value of a tuple before another transaction is completed / committed. If the 2nd transaction aborts / rolls back, the value read by the 1st is inconsistent. +This would be avoided by preventing the 1st transaction from reading until the 2nd has completed ( commit or abort ). + +# Inconsistent Analysis Problem + +A transaction reads several values, a second transaction updates some of them during the execution of the first. This creates inconsistent values across the effected tuples. +This would be avoided by preventing reads of targeted tuples until the first transaction has committed or aborted updates. + +# Conflicting Actions - General Rules + +- Two transactions do not conflict if they: + - Are only reading data items + - Operate on completely different data items +- Two operations conflict if all of these are true: + - Belong to different transactions + - Access same data item + - At least on writes the item