18-Transaction-Processing-and-ACID-SAMPLE-A-Level
18-Transaction-Processing-and-ACID-SAMPLE-A-Level
Free Sample
THANK YOU FOR DOWNLOADING THIS FREE SAMPLE RESOURCE!
Here, you’ll find a snippet of the module, which you can use to gauge the quality
of our offering, but will also find super useful in the classroom.
teachcomputerscience.com
Teach Computer Science
A-Level
Transaction
Processing and
ACID
teachcomputerscience.com
1.
Revision notes
teachcomputerscience.com
Transaction
A transaction is a single logical operation in a database. Booking a
ticket in an airline ticket reservation system is an example of a
transaction. A transaction consists of several actions. Even though
many users can access and edit data at the same time, a database
ensures the changes are reflected to all of them. This property in a
database is called concurrency.
It is important to ensure that all users view the same data. A
transaction must be completed as a whole. Incomplete transactions
must be cancelled. An example of an incomplete transaction in an
airline ticket reservation system is a person trying to book a ticket and,
due to some reason, he is unable to pay. So, the complete transaction
must now be cancelled.
ACID
A transaction must follow:
• Atomicity
A transaction consists of multiple operations that are considered as a
single entity. A transaction is recorded only when the change is
completed. An incomplete change is not recorded.
• Consistency
A transaction must ensure that the database is in a valid state after its
completion. The rules of the database defined in referential integrity
must be followed. Consider a part of database the School that
calculates grades of students.
Teacher
teachcomputerscience.com
In this database, let us consider the table CourseGrade that stores
information about Student ‘Alex’. This record cannot be deleted from
Student table.
Similarly, you cannot add a new student to CourseGrade, without
adding it to Student table first.
• Isolation
A transaction is independent and does not manipulate other
transactions. Hence, multiple transactions running at the same time
produce the same results even when running sequentially.
• Durability
Once a transaction is committed, it must be able to survive
successfully even after a power failure or crash. For example: a booked
ticket remains booked even if there is a power failure. The processing
of a transaction takes place in a buffer and once it is completed, the
changes are reflected in the database.
Challenges in transaction
processing
What happens when a user processes a transaction? Firstly, the
records in which the transaction operates is copied to the local system
of the user. The transaction is processed, and the records are saved.
Lastly, the records are copied to the database. A single user operating
a database by sequentially processing each transaction may not face
any challenges. But a database that is updated by multiple users faces
several challenges. For example: In the Student database, a teacher
updates the Grades of students of a course and saves the record. At
the same time, the Admin of the school updates a few details of
Students and saves the records. Now, it’s possible that some of the
updates could have been missed.
In a multi-user environment, if some protocols are not followed, it may
lead to loss of updates.
teachcomputerscience.com
2.
Activities
teachcomputerscience.com
Activity-1
Duration: 20 minutes
teachcomputerscience.com
Activity-1
Duration: 20 minutes
teachcomputerscience.com
Flashcards
A database management
system (DBMS) is a systems
What is a DBMS? software to define, create
and manipulate information
in a database.
teachcomputerscience.com
Glossary
teachcomputerscience.com
Quiz
1. Which of the following is a function of a database management
system?
A. Acts as a tool to record, manage and organise information in
a database.
B. It provides an interface for the user to work with data.
C. Acts as a backup
D. All of the above
Questions 2 and 3:
A file is used to store and manage a library.
2. The librarian enters a lending transaction without the name of
the book. What issue is this?
A. Data security issue
B. Data integrity issue
C. Data redundancy
D. Data dependency
teachcomputerscience.com
Teach Computer Science
http://creativecommons.org/licenses/by-nc/4.0/
Thank you!
teachcomputerscience.com
Teach Computer Science
We hope it has been useful for you in the classroom and that your
students enjoy the activities.
For more teaching resources like this, don’t forget to come back
and download the new material we add every week!
teachcomputerscience.com