This website houses notes from my studies at the University of Liverpool. If you see any errors or issues, please do open an issue on this site's GitHub.
Precedence in Arithmetic Expressions Consider we run the following in the python shell: >>> 2 + 3 * 5 17 This could be represented as the following trees: graph subgraph 25 25*[*] --- 25+[+] & 255[5] 25+ --- 252[2] & 253[3] end subgraph 17 17*[*] --- 17+[+] & 175[5] 17+...
This covers tutorial 4. Add links to answers to this tutorial. Locks See the answers for tutorial 4 for this question. Logging & Recovery Recovery with undo-logging: Change the value of $X$ on disk back to 10 and call abort for $T_1$ and $T_2$. Change: $Z=30$ $X=10$ on disk and...
Architectural Design This stage represents the link between specification and design processes: Often carried out in parallel with some specification activities. Involves identifying major system components and their communications. Architectural Design Process System Structuring The system is decomposed into several principal sub-systems and communications between these sub-systems are identified. Control...
Good systems have the following properties: Useful and Usable Reliable (Low Coupling) Flexible (Low Coupling, High Cohesion) Easy to modify for different purposes and in event of change. Affordable (Software Reuse) Available (Decreased development time through reuse.) Module Interfaces The interface of a module is how you interact with the...
Software Design The requirement for software should be split into several object-oriented classes so that development can be distributed between several developers. Additionally the end software needs to be: Simple Understandable Flexible Portable Re-usable Stages of Design Problem Understanding Look at the problem from different angles to discover the design...
Redo Logging Logs activities with the goal of restoring committed transactions (ignoring incomplete transactions). Log Records: Same records as before and… New meaning of <T, X, v>: Transaction T has updated the value of database item $X$ and the new value of $X$ is $v$. Direct response to write(X) This...
Logging The following activities should be written to the log so that a desired database state can be recovered later: Starts of transactions, commits and aborts. Modification of database items. This should be implemented in such a way that it should work even if the system fails. You can use...
Reasons For Transaction Abortions Errors while executing transactions: Violation of integrity constraints, other run-time errors. Multiple people in a seat that should only relates to one customer. Deadlocks: Concurrency control requests to abort transactions. When using two-phase locking. Explicit Request: User says ROLLBACK; after they START TRANSACTION;. Reasons Beyond the...
Basic locks are very simple, but not very precise: If we just want to read we need a full lock, even though conflicts don’t happen on a read-read. 2PL Issues 2PL ensure conflict-serialisability, by might lead to: Deadlocks - Where transactions are forced to wait forever. Other issues to be...
See Locking Conflict-Serialisable Schedules for how two phase locking works. If $S$ is a schedule containing only 2PL transactions, then $S$ is conflict-serialisable. Claim: We can move all operation of $T_i$ to the beginning of the schedule (using swaps of consecutive non-conflicting operations). No formal definition is given in this...