Font Size: a A A

Research And Implementation Of Distributed Transaction Processing Model

Posted on:2022-01-12Degree:MasterType:Thesis
Country:ChinaCandidate:T Q YuFull Text:PDF
GTID:2518306524493334Subject:Master of Engineering
Abstract/Summary:PDF Full Text Request
In the era of big data,the development of mobile Internet,smart devices and Internet of Things technology has led to the explosive growth of global data volume,and the traditional stand-alone database is limited by the scalability,which is difficult to carry massive business needs.Distributed database has the characteristics of strong consistency,high availability,scalability,easy operation and maintenance,fault tolerance and disaster recovery,and has high concurrent transaction processing capability to meet ACID characteristics,which can meet the needs of low latency and massive concurrent processing.Distributed databases generally use multiple partitions and multiple copies to achieve scalability and high availability.Distributed transactions often have to compromise between strong consistency and transaction performance,which makes the study of distributed transactions one of the most challenging tasks in the field of distributed databases.In this paper,we take distributed transaction processing model as the research background,investigate the implementation principles of mainstream distributed transaction models,and analyze their advantages and disadvantages.Based on this,we design and implement a transaction processing model for distributed relational databases,drawing on the ideas of the Percolator transaction model.The model is implemented to provide strong consistency cross-partition transaction guarantees through a two-phase commit protocol,with a global unique timestamp provided by a central timing node to achieve snapshot isolation level.The main work of this paper includes.1.Design and implement the optimistic transaction model to cache record modification operations in the computation layer during the add-delete-check phase,and commit them through a two-phase commit protocol during transaction commit.Adopt multi-version concurrency control mechanism,read operation reads snapshot version data to achieve read and write without blocking each other.2.To solve the problem of transaction performance degradation under high transaction conflict scenarios,we implement a pessimistic transaction model based on the optimistic transaction model,write pessimistic locks to all records in advance during the add-delete-change-check phase,advance the timing of transaction conflict detection,and reduce transaction conflict rollback.3.To address the problem of high latency of distributed transactions,design and implement the asynchronous commit protocol,which returns the client response immediately after completing the first stage of writing,while completing the second stage of transaction commit asynchronously to reduce the transaction latency caused by one round of network IO.4.For the scenario of single-partition transaction,we design and implement the onestage commit protocol to omit the steps of locking and unlocking records,and complete the transaction commit in one network IO,thus improving the transaction performance.In this paper,we use test tools such as TPC-C and Sysbench to test the functionality and performance of transactions.The test results show that the transaction system supports ACID feature and implements snapshot isolation level.The performance of the pessimistic transaction model is significantly better than that of the optimistic transaction in a serious conflict scenario,the asynchronous commit transaction can reduce the response time of the transaction while ensuring consistency,and the use of the one-stage commit protocol in a single-partition transaction scenario can greatly improve the transaction performance.
Keywords/Search Tags:Distributed Transactions, Distributed Database, Multi-version concurrency control(MVCC), Two-phase commit(2PC)
PDF Full Text Request
Related items