* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Concurrency Control
Survey
Document related concepts
Entity–attribute–value model wikipedia , lookup
Open Database Connectivity wikipedia , lookup
Oracle Database wikipedia , lookup
Consistency model wikipedia , lookup
Ingres (database) wikipedia , lookup
Global serializability wikipedia , lookup
Functional Database Model wikipedia , lookup
Relational model wikipedia , lookup
Microsoft Jet Database Engine wikipedia , lookup
Database model wikipedia , lookup
Extensible Storage Engine wikipedia , lookup
Clusterpoint wikipedia , lookup
Commitment ordering wikipedia , lookup
Versant Object Database wikipedia , lookup
ContactPoint wikipedia , lookup
Transcript
CONCURENCY CONTROL DISTRIBUTED DATABASE MAIN TOPICS Transaction managements Centralized database Distributed database Consistency control Centralized database Distributed database DATABASE CONSISTENCY 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 TRANSACTION Transaksi merupakan kumpulan dari operasi yang dilakukan pada sebuah data Suatu transaksi harus mempunyai sifat ACID (Atomicity, Consistency, Isolation, Durability) TRANSACTION (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 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. TRANSACTION LIFE CYCLE MULTITRANSACTION PROCESSING SYSTEM Schedule Conflict Equivalence Serializable Schedule SCHEDULING 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 SERIAL AND PARALLEL SCHEDULE SERIES TRANSACTION Two or more transactions running in series maintain the consistency of database CONFLICTS Conflicts occurs when two running transactions perform noncompatible operations on the same data item of the database CONFLICTS (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) EQUIVALENCE 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 EQUIVALENCE TRANSACTION Example: SERIALIZABLE SCHEDULE 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 SERIALIZABLE EXAMPLE SERIALIZABLE EXAMPLE