摘要:
海量数据存储与访问是系统设计与使用的瓶颈问题,利用开源的分布式存储数据库MyCat,通过对数据进行水平切分,将不同的表映射到不同的数据引擎上,从逻辑上实现了数据库容量的扩充.但是,利用数据操纵语言DML访问My-Cat的全局表时,如果遇到异常情况致使某个节点断开连接,可能导致出现多个不同分库数据不一致的问题.针对MyCat分布式数据库中间件的这一弱分布式事务问题,提出一种表广播机制的解决方案.该方案通过改变原始MyCat在DML访问时对全局表的执行逻辑,将作用于所有节点的操作改成对主节点的操作,再通过表广播机制完成各节点间的数据同步,实现各节点间的数据一致性.并利用通用的DML访问实现表广播机制的MyCat数据库中的数据对MyCat进行了性能测试,测试结果表明,基于MyCat的表广播机制在SQL高效率执行的同时,也保证了各数据节点间的数据一致性.%The storage and access of massive data is the bottleneck of system design and use.The MyCat,an open source distributed stor-age database,makes the different tables mapped to different data engines through the horizontal segmentation of the data,which realizes the capacity extension of database logically.However,when using the data manipulation language (DML) to access the global table of MyCat,if a node is disconnected due to an abnormal situation,it may lead to the inconsistencies in the number of different sub-library da-ta.For the problem of weak distributed transaction in MyCat distributed database middleware,we put forward a kind of solution about ta-ble broadcast mechanism.By changing the execution logic of the global table while the original MyCat accessing to the DML,the pro-gram changes the operation of all nodes to that of the master node,and implements the data consistency between the nodes by data syn-chronization between the nodes of the table broadcast mechanism.Then the MyCat is tested by common DML accessing to achieve the da-ta in MyCat database of table broadcast mechanism,which shows that the table broadcast mechanism based on the MyCat is efficient in SQL and also guarantees the data consistency between the nodes.