Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

CONCURENCY CONTROL DISTRIBUTED DATABASE. M AIN TOPICS Transaction managements Centralized database Distributed database Consistency control Centralized.

Presentasi serupa


Presentasi berjudul: "CONCURENCY CONTROL DISTRIBUTED DATABASE. M AIN TOPICS Transaction managements Centralized database Distributed database Consistency control Centralized."— Transcript presentasi:

1 CONCURENCY CONTROL DISTRIBUTED DATABASE

2 M AIN TOPICS Transaction managements Centralized database Distributed database Consistency control Centralized database Distributed database

3 D ATABASE C ONSISTENCY Setiap data yang disimpan ke dalam database harus konsisten Dikatakan konsisten jika data yang dimasukkan ke dalam database, sesuai dengan kriteria Misal: SSN (social security number harus mempunyai nilai unik) Umur harus mempunyai nilai positif Employee harus bekerja pada satu departemen Saldo dalam rekening harus mempunyai nilai positif

4 T RANSACTION Transaksi merupakan kumpulan dari operasi yang dilakukan pada sebuah data Suatu transaksi harus mempunyai sifat ACID (Atomicity, Consistency, Isolation, Durability)

5 T RANSACTION ( CONT ’ D ) Suatu transaksi di dalam database yang utama adalah proses Read dan Write Setiap transaksi berisi sekumpulan operasi yang terurut Pada multi-user transaction processing terdapat banyak transaksi yang dijalankan dalam sekali waktu, dan bisa jadi operasi-operasi yang dilakukan saling tumpang tindih

6 ACID Atomicity – all of the operation of transaction are carried out or none of them are carried out. Consistency – property of transaction requires a transaction to be written correctly Isolation – property of transaction requires that transaction to be run out without interference from other transaction – can be achieve by locking or timestamping Durability – property of a transaction requires the value that the transaction commit to the database persistent.

7 T RANSACTION LIFE CYCLE

8 M ULTITRANSACTION PROCESSING SYSTEM Schedule Conflict Equivalence Serializable Schedule

9 S CHEDULING Schedule is a the total order of operations or set of transactions. Scheduling type Serial Schedule – the operations for each transaction do not overlap in time Parallel Schedule – the operations for each transaction do overlap in time

10 S ERIAL AND PARALLEL SCHEDULE

11 S ERIES TRANSACTION Two or more transactions running in series maintain the consistency of database

12 C ONFLICTS Conflicts occurs when two running transactions perform noncompatible operations on the same data item of the database

13 C ONFLICTS ( CONT ’ D ) Each of that schedule produce some anomalies Unrepeatable read anomaly (in-S1) Reading uncommitted data / dirty read anomaly (in S2) Overwriting uncommitted data anomaly (in S2)

14 E QUIVALENCE The problems Concurrent transactions can cause anomaly – the anomaly can destroy consistency of database Solution Run all transaction in series Run transaction concurrently Goal Preserve the consistency of database If the 2nd solution can achieve the goal – Equivalence

15 E QUIVALENCE TRANSACTION Example:

16 S ERIALIZABLE S CHEDULE A schedule is said to be serializable if it equivalent to serrial schedule The check for serial schedule equivalence - serializability. The T1 transaction (R1, W1) must be committed, before T2 transaction (R2, W2) being executed

17 S ERIALIZABLE EXAMPLE

18

19


Download ppt "CONCURENCY CONTROL DISTRIBUTED DATABASE. M AIN TOPICS Transaction managements Centralized database Distributed database Consistency control Centralized."

Presentasi serupa


Iklan oleh Google