Applying Attribute Level Locking to Decrease the Deadlock on Distributed Database



Similar documents
Implementing New Approach for Enhancing Performance and Throughput in a Distributed Database

Udai Shankar 2 Deptt. of Computer Sc. & Engineering Madan Mohan Malaviya Engineering College, Gorakhpur, India

Roadmap DB Sys. Design & Impl. Detailed Roadmap. Paper. Transactions - dfn. Reminders: Locking and Consistency

Concurrency Control. Chapter 17. Comp 521 Files and Databases Fall

Fragmentation and Data Allocation in the Distributed Environments

Optimizing Concurrent Processing of Write-then-Read Transactions

TECHNIQUES FOR DATA REPLICATION ON DISTRIBUTED DATABASES

IT2304: Database Systems 1 (DBS 1)

City University of Hong Kong. Information on a Course offered by Department of Computer Science with effect from Semester A in 2014 / 2015

Locality Based Protocol for MultiWriter Replication systems

Consistency Management for Multiple Perspective Software Development

A Novel Cloud Computing Data Fragmentation Service Design for Distributed Systems

Lecture 7: Concurrency control. Rasmus Pagh

Lossless Grey-scale Image Compression using Source Symbols Reduction and Huffman Coding

An Algorithmic Approach to Database Normalization

CS 525 Advanced Database Organization - Spring 2013 Mon + Wed 3:15-4:30 PM, Room: Wishnick Hall 113

IV Distributed Databases - Motivation & Introduction -

Load Balancing in Distributed Data Base and Distributed Computing System

Concurrency Control. Module 6, Lectures 1 and 2

Concurrency control. Concurrency problems. Database Management System

STUDY AND SIMULATION OF A DISTRIBUTED REAL-TIME FAULT-TOLERANCE WEB MONITORING SYSTEM

A Security Approach in System Development Life Cycle

Load Balancing in cloud computing

International Journal of Advanced Research in Computer Science and Software Engineering

CS 245 Final Exam Winter 2013

A Visualization System and Monitoring Tool to Measure Concurrency in MPICH Programs

An Overview of Distributed Databases

Mining Association Rules: A Database Perspective

Survey on Comparative Analysis of Database Replication Techniques

USING REPLICATED DATA TO REDUCE BACKUP COST IN DISTRIBUTED DATABASES

Performance Analysis of AQM Schemes in Wired and Wireless Networks based on TCP flow

Databases. DSIC. Academic Year

IT2305 Database Systems I (Compulsory)

Homework 8. Revision : 2015/04/14 08:13

International Journal of Advanced Research in Computer Science and Software Engineering

Deadlock Detection and Recovery!

Proposed Pricing Model for Cloud Computing

Database Application Developer Tools Using Static Analysis and Dynamic Profiling

Wireless Sensor Networks Database: Data Management and Implementation

Performance Analysis of Naive Bayes and J48 Classification Algorithm for Data Classification

Performance Targets for Developers

PostgreSQL Concurrency Issues

A SIMULATOR FOR LOAD BALANCING ANALYSIS IN DISTRIBUTED SYSTEMS

Database Replication with Oracle 11g and MS SQL Server 2008

An Approach to Load Balancing In Cloud Computing

Optical interconnection networks with time slot routing

A Comparison of Dynamic Load Balancing Algorithms

Keywords: Regression testing, database applications, and impact analysis. Abstract. 1 Introduction

Steps to System Reconfiguration in a Distributed Database System: A Fault-tolerant Approach

International Journal of Advanced Research in Computer Science and Software Engineering

Load Distribution in Large Scale Network Monitoring Infrastructures

Lecture Outline Overview of real-time scheduling algorithms Outline relative strengths, weaknesses

SCHEDULING IN CLOUD COMPUTING

A Replication Protocol for Real Time database System

Proceedings of the International MultiConference of Engineers and Computer Scientists 2013 Vol I, IMECS 2013, March 13-15, 2013, Hong Kong

A Middleware Strategy to Survive Compute Peak Loads in Cloud

Extending Multidatabase Transaction Management Techniques to Software Development Environments

A Comparative Performance Analysis of Load Balancing Algorithms in Distributed System using Qualitative Parameters

Horizontal Aggregations In SQL To Generate Data Sets For Data Mining Analysis In An Optimized Manner

Data Management in the Cloud

A Case Study Research on Software Cost Estimation Using Experts Estimates, Wideband Delphi, and Planning Poker Technique

Two Approaches to Internet Traffic Engineering for End-to-End Quality of Service Provisioning

KEYWORD SEARCH IN RELATIONAL DATABASES

THE IMPACT OF INHERITANCE ON SECURITY IN OBJECT-ORIENTED DATABASE SYSTEMS

A Rule-Oriented Concurrent Architecture to Effect Adaptiveness for Integrated Manufacturing Enterprises

Development models. 1 Introduction. 2 Analyzing development models. R. Kuiper and E.J. Luit

Performance Comparison of Database Access over the Internet - Java Servlets vs CGI. T. Andrew Yang Ralph F. Grove

A Genetic Algorithm Approach for Solving a Flexible Job Shop Scheduling Problem

1. Comments on reviews a. Need to avoid just summarizing web page asks you for:

IMPROVED PROXIMITY AWARE LOAD BALANCING FOR HETEROGENEOUS NODES

Lecture 4. Parallel Programming II. Homework & Reading. Page 1. Projects handout On Friday Form teams, groups of two

M. Sugumaran / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 2 (3), 2011,

How To Compare Load Sharing And Job Scheduling In A Network Of Workstations

Application of Predictive Analytics for Better Alignment of Business and IT

Resource Allocation Schemes for Gang Scheduling

Layered Approach to Development of OO War Game Models Using DEVS Framework

Load Balancing in Distributed System. Prof. Ananthanarayana V.S. Dept. Of Information Technology N.I.T.K., Surathkal

Comparative Study of Load Balancing Algorithms

Six Strategies for Building High Performance SOA Applications

New Matrix Approach to Improve Apriori Algorithm

Detecting Multiple Selfish Attack Nodes Using Replica Allocation in Cognitive Radio Ad-Hoc Networks

Transcription:

Applying Attribute Level Locking to Decrease the Deadlock on Distributed Database Dr. Khaled S. Maabreh* and Prof. Dr. Alaa Al-Hamami** * Faculty of Science and Information Technology, Zarqa University, Al Zarqa - Jordan kmaabreh@zpu.edu.jo ** Graduate College of Computer Studies, Amman Arab University, Amman Alaa-hamami@yahoo.com ABSTRACT In a distributed database, a transaction consists of several participants' or agents to execute over all sites; all participants must guarantee that any change to data will be permanent in order to commit the transaction. If any of participants fails to make this guarantee, the entire transaction fails and aborts. There are many approaches according to where the lock management is performed. One of them is the centralized locking, where one site is responsible for granting locks, because it s the only site that has a lock manager. This research applying a new method for reducing the size of lockable entities, it is possible to do that by increasing the granularity hierarchy tree one more down at the attributes, to allow several transactions to access the same raw simultaneously. The experimental results proved that, using Attribute locking will decrease the competition for acquiring the data and increases the concurrency control for the Distributed Database. Keywords: Distributed Database, Locking, Deadlocks, Concurrency Control, Performance. INTRODUCTION A distributed transaction is a set of operations, in which two or more network hosts are involved [, ]. Each host or computer has a local transaction manager responsible for interacting with other transaction managers via either a superior or subordinate relationship, in case of a transaction does work at multiple computers [,,, 8, 9]. When a transaction needs to lock a data item, it sends a request to the central site, whose determines if the lock can be granted, if so, it sends a message to the originated site, else it will wait. In case of read operations, the transaction perform its action from any site who has a copy of the required data item, whereas in a write case, all sites owning a copy must participate in this action [, ]. The simplicity in implementation and simplicity in deadlock handling are two factors considered in choosing the central locking approach, because we have not real data and not concerned with designing real distributed database system; rather we are concerned with measuring the attribute locking approach against system performance. The rest of the paper is organized as follows: Section states the problem with using row locking as a minimum lockable unit. Section states the proof of concepts, section presents the enhanced algorithm for field locking approach, experiments are drawn in section, analysis and conclusion are drawn in section.. THE PROBLEM The problem is due to the incremental number of users to database, and the competition for acquire a data items becomes very high []. This research aims to increase the granularity hierarchy tree [, ] one more down, to include the attribute, i.e. locking will be done at the attribute to allow several transactions to access the same row simultaneously. The suggested is expected to decrease the user competition for acquiring data items and to increase the performance of the database. However, this will increase the overhead on the database.. THE PROPOSED SOLUTION The proof of the enhanced procedure will be given by building a discrete events simulation program to generate transactions randomly, after building the hierarchy tree representing the database with new added (attributes), and by building a database lock manager [, ] responsible for coordination transactions execution, the program was built by using Java technology. Data will be gathered to measure system performance, system throughput, and locking overhead [, ], the proposed procedure will executes against the database row as the minimum lockable database unit, then it will executes to reflect the new added, comparing between two results

will be drawn. The proposed procedure is expected to increase the concurrency, reduce the deadlock problem occurrences [], and increase performance and system throughput. The simulation parameters (table ) will be used to generate multiple snapshots during progresses of a database, these parameters will be vary for each run in order to show the system behavior. The following assumptions are also considered: The time needed for setting and releasing locks is assumed to be ms. Input output time needed for each operation is assumed to be ms. needed to complete data processing is randomly selected between to ms. Communication delay is assumed to be negligible, because the communication performance is not considered to be measured here. Parameter num-table min-numtuples max-numtuples min-col max-col min-trans-size max-trans-size num_trans queue-len db-number num-sites Table. (Simulation parameters) Description Number of tables in a database Minimum number of tuples in each row Maximum number of tuples in each table Minimum number of columns in each table Maximum number of columns in each table Minimum transaction size (number of operations) Maximum transaction size (number of operations) Number of transactions in the system Maximum queue length Number of databases for each site Number of sites Value, Up to Read and writes sets in a transaction, are assumed to be equals, because of simplifying the analysis and we did not have an actual data that could serve as an indication of what would be realistic distribution of the size of the read or write sets.. THE ENHANCED ALGORITHM DESCRIPTION FOR LOCKING ATTRIBUTES The locking could be obtained on the entire database, entire table, page, row or attribute according to compatibility matrix for granularity hierarchy table. The transaction can lock a node in top-down order and unlock in bottom-up order by using the rules mentioned in [] in addition to:. The database row is considered as a node, and can be locked in an intention modes (IS or IX).. The key of the row must be locked in a Shared (S) mode, when the transaction does not need the whole row.. The locking of attributes as database nodes must be done according to database constraints.. Other attributes can be locked in S or X mode. When a conflict occurs, or when the transaction needs to read or update the whole row, it's locked as in row locking. Table. (Compatibility matrix) IS IX S SIX X IS T T T T F IX T T F F F S T F T F F SIX T F F F F X F F F F F The abbreviations S, X, IS, IX and SIX are stated for: shared locks (Read), exclusive locks (Write), intentionshared (i.e. explicit locking is being done at lower of the tree with shared mode locks), intention-exclusive (i.e. the explicit locking will be used at a lower of the tree with exclusive mode or shared-mode locks) and shared with intention-exclusive (i.e. the sub tree rooted by that node is locked explicitly in shared mode and explicit locking is being done at lower with exclusive-mode) respectively [, ]. Databases are assumed to be well normalized and have a set of assertions to satisfy its correct state [, ], for example, if a database has associates with such assertion (Z=X+Y). So, these items must locked together when using attribute locking, this is the responsibility of a database lock manager to

accomplish this task, in this example case, the transaction must lock both X and Y when it needs to lock Z.. EXPERIMENTAL WORK. PERFORMANCE EVALUATION OF ROW LEVEL LOCKING The results shown in table are presented to appear the behavior of the system during runs, (times are measured in seconds), we can see that, the system begin thrashes when the number of transactions entering the system becomes or higher Figure, which means that, the system does not complete all transactions entering the system, (i.e. the competition among transactions as well as the probability of conflict becomes high Number of Transactions Table. (Results of runs of simulation at row locking) Completed Transactions Simulation Mean Service Mean Waiting.9.99 8....89. 8 9. 9...98.98 9.9.9.9..8 8 9...9.. 8 8...8.9.8 8 9...9.. 9 8. 8. 8 8.9.. 8 9. 9. 9 9.9.. 9...8.9.8 9.8.8.9...9.9...99 9.8.8..9.8 8....8.9 8.9.9 8 9... 8..8..9.8 8 9....98. 8.9. 8.8..9 8 9.. 9 8 9.9..9 9. 9. 8...9 8.8 8. 8...8 8.8.8 9..8. 8.9. 99.9.....89.. 9.88.9...8.88.8 Mean Number of Operations Mean Number of locks Arrival rate. 8..... 8..... 8..... 8 9 System Begin Thrashes WorkLoad (Number of transactions) 8 9 Figure. (System at row locking) Mean service time and mean waiting time Figure, are increased when the number of transactions entering the system increased, Figure shows the mean number of locks needed by transactions at row locking. Mean Number of Locks 8 9 System oerformance 8 Workload (Number of Transactions) 9 Figure. (System performance at row locking) 8 9 Locking Overhead Mean Waiting Mean Service 8 9 Figure. (System locking overhead at row locking). Performance evaluation of field locking After modifying the hierarchy tree by adding the attributes to be locked, simulation is executes times on different workloads to show the system behavior, the results are presented in table. The new system (alternative two) executes up to 9 transactions successfully without deadlock, when the number of transactions becomes or higher, the system begin thrashes as shown in figure. The important thing is that, transactions are completed

successfully on alternative two (at field locking), while there are two transactions were deadlocked, when using the row as minimum lockable unit. Number of Transactions Table. (Results of runs of simulation at field locking) Completed Transactions Simulation Mean Service Mean Waiting..9 8.8.8... 9. 9..9.. 9 8...9.9.98 8..... 8....8.8 8....8.8 9 8.8 8.8 8 8.99.88.8 8.. 9 9..89.....9. 9.8.8.8.......8 9.8.8.9.. 8.9.9.8.9. 8...9.8. 8...88.. 8.8.8.9.... 8 8..9.8 8.. 9 9.8..9.. 98 9... 9...9.99. 9..9..8. 8....89..99. 8..9.89 8.88.8...8..9. 8..... 8..... 8..... 8 9 Mean Number of Operations System Mean Number of locks Begin Thrashes WorkLoad (Number of transactions) Arrival rate 8 9 Figure. (System throughput at field locking) Mean service time and mean waiting time on alternative two, becomes less than those produced when using alternative one, figure shows this behavior, because the transaction does not need to waits for long time to get its lock. But unfortunately, the mean number of locks is increased figure. Mean Number of Locks System oerformance 89 8 9 Workload (Number of Transactions) Mean Waiting Mean Service Figure. (System performance at row locking) 8 9 Locking Overhead 8 9 Figure. (System locking overhead at row locking). Comparing the two alternatives Table, shows mean service time, mean waiting time, throughput and the mean number of locks for the two alternatives, in order to compare between them. Number of Transactions Table. ( locking versus field locking performance) R o w l e v e l l o c k i n g Mean Service Mean Waiting Mean Number of Locks F i e l d l e v e l l o c k i n g Mean Service Mean Waiting.99..9.8.89. 9. 8.. 9..98.98.9... 8..8. 9.9.98.... 8....9.8. 9.8.8... 8..8.8 8.8 Mean Number of locks 8.. 9..88.8.

9... 9.89.. VS mean waiting time.9.8.8.9..8...9.....99.8..8.8.9.8....9.8.9.9.9.....8.8...9.8. 9...8.98.. 8... 8..9. 9.9.8. 9..9 9...9...9 8.... 9..8.8.99..9 9.8...8......89.....9 9.9.89.8 8..8.8..8.9....... 89 VS Begin Thrashes 8 9 Figure. ( for two alternatives) 8 9 Mean number of locks Workload (number of transactions) 8 9 Figure 9. (Mean waiting time for two alternatives) 8 9 VS locking overhead 8 9 Figure. (Locking overhead for two alternatives) The throughput for field locking is higher than for row locking as shown in figure, because the competitions among transactions becomes less due to increasing in a database size. Alternative one (row locking) becomes thrashes before alternative two (field locking). At the same time, the mean service time and mean waiting time in alternative two becomes less in general figures 8 and 9, because transactions can proceed immediately when no conflicts occur. The locking over head figure, increased because at field locking approach, the lock manager needs extra work to manage the locks needed. VS mean service time 89 8 9 Figure 8. (Mean service time for two alternatives). CONCLUSION Simulation is implemented to prove the idea of obtaining a lock at attributes on a distributed database. The discussion presented in sections. through., shows that the system at field locking behave more better than at row locking, because multiple transactions can proceed at the same database row simultaneously, which decreases the mean service time as well as the mean waiting time, because transactions does not need to wait for a long time to get their locks, which increases the availability of data. Also alternative two executes more transactions than alternative one at a time unit before thrashing occurs, which means that, the deadlock occurrences becomes less.

REFERENCES. Bernstein P. A., Hadzilacos V., and Goodman N. "Concurrency Control and Recovery in Database Systems", Addison-Wesley, 98.. Bernstein P. and Newcomer E., "Principles of Transaction Processing for the Systems Professional", Bentham Press,.. Chandy K. M., Misra J. and Hass L.M., "Distributed Deadlock detection", ACM Transactions on Computer Systems, Vol., No., 98.. Coffman, E.G., Elphick M. J., and Shoshani A., "System Deadlocks", ACM Computing Surveys, Vol., No., PP: 8, 9.. Eswaran K. P., Gray J. N., Lorie R. A. and Traiger I. L., "The Notions of Consistency and Predicate Locks in a Database System", ACM archive, New York, Volume 9, Issue, 9.. Elmasri R. and Navathe S.B. "Fundamentals of Database Systems", th edition, Pearson Addison Wesley (Boston),.. Gary J. N., Lorie R. A., Putzolu G. R. and Traiger I. L., "Granularity of Locks and Degrees of Consistency in a Shared Data Base" In IFIP Working Conference on Modelling in Data Base Management Systems, pages --9, 9. 8. Ling Y., Chen S. and Chiang C.J., "On Optimal Deadlock Detection Scheduling", IEEE Transactions on Database, Vol., Issue: 9, PP: 8 8,. 9. MSDN (Microsoft Developer Network): http://msdn.microsoft.com/enus/library/ms8(vs.8).aspx Accessed on 9//8.. Ozsu M. T. and Valduriez P., "Principles of distributed database systems", nd edition, Prentice-Hall, Inc, New jersey99.. Silberschatz A., Korth H.F. and Sudarshan S. "Database System Concepts", th edition, McGraw-Hill, New York,.. Sinha M. K. " Constraints: consistency and integrity", ACM SIGMOD, Volume, Issue, New York, 98.. Weikum G. and Vossen G., "Transactional Information Systems, Theory, Algorithms and the Practice of Concurrency Control and recovery", Morgan Kaufman Publishers,. http://en.wikipedia.org/wiki/distributed_trans action_processing. Accessed on 9//8.. Wu H., Chin W. and Jaffar J., "An efficient distributed deadlock avoidance algorithm for the AND model", IEEE Transactions on Volume 8, Issue, PP: 8 9, Jan.. Yeung C., Hung S. and Lam K., "Performance evaluation of a new distributed deadlock detection algorithm", ACM SIGMOD, Volume, Issue, 99.. Wikipedia Encyclopedia: