diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 35f0b7b..9ea3567 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -6,7 +6,7 @@ { "id": "7b5e68cfd661dd0d", "type": "tabs", - "dimension": 49.11924119241192, + "dimension": 59.34959349593496, "children": [ { "id": "505b4bbc8a7e15f6", @@ -25,7 +25,7 @@ { "id": "0df2a38b58c879ff", "type": "tabs", - "dimension": 50.88075880758808, + "dimension": 40.65040650406504, "children": [ { "id": "a9b5c2a99473859a", @@ -33,7 +33,7 @@ "state": { "type": "pdf", "state": { - "file": "Semester 2/Database Systems/Booklet of Lecture Slides for Semester Two (2).pdf" + "file": "Semester 2/Database Systems/Exercise Booklet.pdf" } } } @@ -186,14 +186,21 @@ }, "active": "505b4bbc8a7e15f6", "lastOpenFiles": [ + "images/Pasted image 20240213172702.png", + "images/Pasted image 20240213172509.png", + "images/Pasted image 20240213172304.png", + "Semester 2/Database Systems/Exercise Booklet.pdf", "Semester 2/Database Systems/Booklet of Lecture Slides for Semester Two (2).pdf", "Semester 2/Database Systems/Week 5/Week 5 Database Systems.md", + "images/Pasted image 20240213161136.png", + "images/Pasted image 20240213133455.png", + "images/Pasted image 20240213132603.png", + "images/Pasted image 20240213132227.png", "images/Pasted image 20240213131815.png", "images/Pasted image 20240213131802.png", "images/Pasted image 20240213131718.png", "Semester 2/Database Systems/Week 4/Week 4 Database Systems.md", "Semester 2/Database Systems/Week 5", - "Semester 2/Database Systems/Exercise Booklet.pdf", "Semester 2/Database Systems/Week 4", "Semester 2/Programming 2/Project/Part 1/__SHELL78.class", "Semester 2/Programming 2/Project/Part 1/__SHELL78.java", @@ -216,13 +223,7 @@ "Semester 2/Database Systems/Week 3/Week 3 Database Systems.md", "Semester 2/Database Systems/Week 2/Week 2 Database Systems.md", "images/Pasted image 20240126103004.png", - "images/Pasted image 20240126102902.png", - "images/Pasted image 20240126101454.png", - "images/Pasted image 20240126101407.png", - "images/Pasted image 20240126101329.png", - "images/Pasted image 20240126101118.png", "CCNA/1 - Networking Today/1.2 - Network Components.md", - "images/Pasted image 20240125163704.png", "CCNA/1 - Networking Today/1.1 - Networks Affect our Lives.md", "CCNA/Module Information.md", "Semester 2/Database Systems/Week 1/Week 1 Database Systems.md", diff --git a/Semester 2/Database Systems/Week 5/Week 5 Database Systems.md b/Semester 2/Database Systems/Week 5/Week 5 Database Systems.md index 9a32a37..6b4b034 100644 --- a/Semester 2/Database Systems/Week 5/Week 5 Database Systems.md +++ b/Semester 2/Database Systems/Week 5/Week 5 Database Systems.md @@ -1,10 +1,68 @@ # Conflict Serialisability + If a concurrent schedule organises conflicting operations in the same way as a serial schedule, the results are the same. This is called conflict serialisability, which can be tested using precedence graphs. ## Directed Graph + - ![](Pasted%20image%2020240213131718.png) - ![](Pasted%20image%2020240213131802.png) - ![](Pasted%20image%2020240213131815.png) + # Precedence Graph +- Used to determine if a schedule is serialisable. +- It is serialisable if the graph has no cycles. + +## Example Using Serial Schedule + +- ![](Pasted%20image%2020240213132227.png) +- This schedule is serialisable because the graph is acyclic. ex. No directed cycle. + +## Example Using Non-Serial Schedule + +- ![](Pasted%20image%2020240213132603.png) +- This schedule is serialisable due to being acyclic. +- It is equivalent due to + - T2 reading the written value of X from T1 + - T1 reading the value of X from the database + - T1 is the last transaction to write Y + - T2 is the last transaction to write X + +## Example Using Non-Serialisable Schedule + +- ![](Pasted%20image%2020240213133455.png) +- This schedule is non-serialisable since the graph is cyclic. + +## Example 4 + +- ![](Pasted%20image%2020240213161136.png) +- Cyclic graph, non serialisable. + +# Tutorial Questions: Chapter 28 + +1. What is a serial schedule? +A serial schedule is an order of operations where each is complete before a new operation starts. Ex. No interleaves operations. +2. Why is a serial schedule considered correct? +Each operation is either successful or aborted before a new operation starts, meaning every operation is correct and the database is consistent. +3. What is a serialisable schedule? +A serialisable schedule is a concurrent schedule with an acyclic precedence graph. The operation is the same as a serial schedule. +4. Why is a serialisable schedule considered correct? +Since the operation is functionally the same as a serial schedule, we can consider it correct. + +5. The precedence graph is serialisable since it is acyclic. No directed cycles. +6. T1.1 -> T2.2, T1.2 -> T2.1, T1.2 -> T2.2, T1.2 -> T3.1, T2.2 -> T3.1 +- ![](Pasted%20image%2020240213172304.png) +The graph is serialisable since there are no directed cycles. + +1. T2.1 -> T1.1, T1.1 -> T2.2, T2.2 -> T1.2 +- ![](Pasted%20image%2020240213172509.png) +The graph is not serialisable since there is a directed cycle + +1. T1.1 -> T2.1, T1.2 -> T2.1 +- ![](Pasted%20image%2020240213172702.png) +The graph is serialisable since there are no directed cycles. + +1. T1.1 -> T2.2, T2.1 -> T1.2, T1.2 -> T2.2 +- ![](Pasted%20image%2020240213172509.png) +The graph is not serialisable since there are directed cycles diff --git a/images/Pasted image 20240213132227.png b/images/Pasted image 20240213132227.png new file mode 100644 index 0000000..1e72d5e Binary files /dev/null and b/images/Pasted image 20240213132227.png differ diff --git a/images/Pasted image 20240213132603.png b/images/Pasted image 20240213132603.png new file mode 100644 index 0000000..9999303 Binary files /dev/null and b/images/Pasted image 20240213132603.png differ diff --git a/images/Pasted image 20240213133455.png b/images/Pasted image 20240213133455.png new file mode 100644 index 0000000..4b4a10d Binary files /dev/null and b/images/Pasted image 20240213133455.png differ diff --git a/images/Pasted image 20240213161136.png b/images/Pasted image 20240213161136.png new file mode 100644 index 0000000..f8ae51e Binary files /dev/null and b/images/Pasted image 20240213161136.png differ diff --git a/images/Pasted image 20240213172304.png b/images/Pasted image 20240213172304.png new file mode 100644 index 0000000..5f6b39d Binary files /dev/null and b/images/Pasted image 20240213172304.png differ diff --git a/images/Pasted image 20240213172509.png b/images/Pasted image 20240213172509.png new file mode 100644 index 0000000..19fe314 Binary files /dev/null and b/images/Pasted image 20240213172509.png differ diff --git a/images/Pasted image 20240213172702.png b/images/Pasted image 20240213172702.png new file mode 100644 index 0000000..44ac773 Binary files /dev/null and b/images/Pasted image 20240213172702.png differ