diff --git a/Semester 2/Database Systems/Week 3/Week 3 Database Systems.md b/Semester 2/Database Systems/Week 3/Week 3 Database Systems.md index e02a12f..e89eb5a 100644 --- a/Semester 2/Database Systems/Week 3/Week 3 Database Systems.md +++ b/Semester 2/Database Systems/Week 3/Week 3 Database Systems.md @@ -96,7 +96,8 @@ No matter the order of these transactions, the total balance of all accounts, £ ## Benefits of Concurrency -### Improved throughput & resource utilisation +### Improved Throughput & Resource Utilisation + CPU and I/O can operate in parallel When disk is not used, a second transaction can be utilising CPU, improving resource utilisation and decreasing waiting times. @@ -104,30 +105,31 @@ When disk is not used, a second transaction can be utilising CPU, improving reso 1. A major objective in developing a database is to enable many users to access shared data concurrently. Explain why concurrent access is relatively easy if all users are only reading data. Illustrate your answer using the example of an on-line railway timetable. -Since the DBMS does not have to update any data in the database, and only has to access it. There is no processing involved, only retrieval. Transactions cannot interfere. +Since the DBMS does not have to update any data in the database, and only has to access it. There is no processing involved, only retrieval. Transactions cannot interfere. -2. Explain the following statement. “A transaction is a logical unit of work.” +1. Explain the following statement. “A transaction is a logical unit of work.” Each transaction is a sequence of logically related commands that accomplish one task and transform the database from one consistent state into another. It must be completed or not completed, no intermediate state is allowed. -3. The DBMS does not guarantee that the semantic meaning of the transaction truly represents the real-world event. Who does have responsibility for the semantic meaning? What are the possible consequences of this limitation? Illustrate your answer using a transaction that is intended to transfer money from one bank account to another. +1. The DBMS does not guarantee that the semantic meaning of the transaction truly represents the real-world event. Who does have responsibility for the semantic meaning? What are the possible consequences of this limitation? Illustrate your answer using a transaction that is intended to transfer money from one bank account to another. The DBMS just checks a transaction has correct syntax. The input, and how the database is created defines the semantic context. The database engineer and front end UX designer has the responsibility to define the semantic meaning of the data. If the online banking page does not define the meaning of an input box to transfer funds, it is not the DBMS' fault. -4. Name the four properties of database transactions which make up the acronym ACID. Describe each of the ACID properties. +1. Name the four properties of database transactions which make up the acronym ACID. Describe each of the ACID properties. Atomicity: Must run to completion or have no effect at all Consistency: Should correctly transform the database from one consistent state or another Isolation: Should appear as though it is being executing in isolation from other transactions & Other transactions executing concurrently should not interfere with the execution Durability: Changes applied must persist -5. Explain why the DBMS alone cannot be expected to uphold the responsibility for the consistency property. Illustrate your answer using a transaction that is intended to transfer money from one bank account to another. +1. Explain why the DBMS alone cannot be expected to uphold the responsibility for the consistency property. Illustrate your answer using a transaction that is intended to transfer money from one bank account to another. Can enforce all constrains that have been specified on the database schema such as integrity constraints. This is insufficient. If the programmer makes a logic error, it will be left inconsistent. The DBMS does not have the ability to correct or detect this. -6. Why do database systems support concurrent execution of transactions, in spite of the extra programming effort needed to ensure that concurrent execution does not cause any problems? +1. Why do database systems support concurrent execution of transactions, in spite of the extra programming effort needed to ensure that concurrent execution does not cause any problems? Having the ability to support concurrent transactions is beneficial to the operation of the database. It improves the waiting time and resource allocation. -7. Justify the following statement. “Executing transactions concurrently is more important when data must be fetched from secondary storage or when transactions are long, and is less important when data is in primary storage and transactions are very short.” +1. Justify the following statement. “Executing transactions concurrently is more important when data must be fetched from secondary storage or when transactions are long, and is less important when data is in primary storage and transactions are very short.” +If the duration is long, running them serially will mean long delays while transactions wait to be processed. Long delays would not be acceptable.