manajemen basis data pertemuan 4
DESCRIPTION
Manajemen Basis Data Pertemuan 4. Matakuliah: M0264/Manajemen Basis Data Tahun: 2008. Objectives. Concurency Control Advanced Transaction Models Transaction Support (Transaksi Pendukung pada SQL). Concurency Control. Meaning of serializability. How locking can ensure serializability. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Manajemen Basis Data Pertemuan 4](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815df8550346895dcc2fb7/html5/thumbnails/1.jpg)
Manajemen Basis DataPertemuan 4
Matakuliah : M0264/Manajemen Basis DataTahun : 2008
![Page 2: Manajemen Basis Data Pertemuan 4](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815df8550346895dcc2fb7/html5/thumbnails/2.jpg)
Bina Nusantara
• Concurency Control• Advanced Transaction Models• Transaction Support (Transaksi Pendukung pada SQL)
Objectives
![Page 3: Manajemen Basis Data Pertemuan 4](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815df8550346895dcc2fb7/html5/thumbnails/3.jpg)
Bina Nusantara
• Meaning of serializability.• How locking can ensure serializability.• Deadlock and how it can be resolved.• How timestamping can ensure serializability.• Optimistic concurrency control.• Granularity of locking.
Concurency Control
![Page 4: Manajemen Basis Data Pertemuan 4](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815df8550346895dcc2fb7/html5/thumbnails/4.jpg)
Bina Nusantara
Concurency Control
• Process of managing simultaneous operations on the database without having them interfere with one another.
• Prevents interference when two or more users are accessing database simultaneously and at least one is updating data.
• Although two transactions may be correct in themselves, interleaving of operations may produce an incorrect result.
![Page 5: Manajemen Basis Data Pertemuan 4](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815df8550346895dcc2fb7/html5/thumbnails/5.jpg)
Bina Nusantara
Concurency Control
• Three examples of potential problems caused by concurrency: – Lost update problem.– Uncommitted dependency problem.– Inconsistent analysis problem.
![Page 6: Manajemen Basis Data Pertemuan 4](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815df8550346895dcc2fb7/html5/thumbnails/6.jpg)
Bina Nusantara
Advanced Transaction Models
• Protocols considered so far are suitable for types of transactions that arise in traditional business applications, characterized by:– Data has many types, each with small number of instances.– Designs may be very large.– Design is not static but evolves through time. – Updates are far-reaching.– Cooperative engineering.
![Page 7: Manajemen Basis Data Pertemuan 4](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815df8550346895dcc2fb7/html5/thumbnails/7.jpg)
Bina Nusantara
Advanced Transaction Models
• May result in transactions of long duration, giving rise to following problems:– More susceptible to failure - need to minimize amount of work
lost.– May access large number of data items - concurrency limited if
data inaccessible for long periods.– Deadlock more likely.– Cooperation through use of shared data items restricted by
traditional concurrency protocols.
![Page 8: Manajemen Basis Data Pertemuan 4](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815df8550346895dcc2fb7/html5/thumbnails/8.jpg)
Bina Nusantara
Advanced Transaction Models• Look at five advanced transaction models:
– Nested Transaction Model– Sagas– Multi-level Transaction Model– Dynamic Restructuring– Workflow Models
![Page 9: Manajemen Basis Data Pertemuan 4](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815df8550346895dcc2fb7/html5/thumbnails/9.jpg)
Bina Nusantara
Transaction SupportTransactionAction, or series of actions, carried out by user or application, whichaccesses or changes contents of database. • Logical unit of work on the database. • Application program is series of transactions with non-database
processing in between. • Transforms database from one consistent state to another, although
consistency may be violated during transaction.
![Page 10: Manajemen Basis Data Pertemuan 4](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815df8550346895dcc2fb7/html5/thumbnails/10.jpg)
Bina Nusantara
Transaction Support
Example Transaction
![Page 11: Manajemen Basis Data Pertemuan 4](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815df8550346895dcc2fb7/html5/thumbnails/11.jpg)
Bina Nusantara
Transaction Support
• Can have one of two outcomes:– Success - transaction commits and database reaches a new
consistent state. – Failure - transaction aborts, and database must be restored to
consistent state before it started. – Such a transaction is rolled back or undone.
• Committed transaction cannot be aborted.• Aborted transaction that is rolled back can be
restarted later.
![Page 12: Manajemen Basis Data Pertemuan 4](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815df8550346895dcc2fb7/html5/thumbnails/12.jpg)
Bina Nusantara
Transaction Support
State Transition Diagram for Transaction
![Page 13: Manajemen Basis Data Pertemuan 4](https://reader035.vdocuments.net/reader035/viewer/2022062520/56815df8550346895dcc2fb7/html5/thumbnails/13.jpg)
Bina Nusantara
Transaction Support
Four basic (ACID) properties of a transaction are:• Atomicity ‘All or nothing’ property. • Consistency Must transform database from one
consistent state to another.• Isolation Partial effects of incomplete transactions
should not be visible to other transactions.• Durability Effects of a committed transaction are
permanent and must not be lost because of later failure.