文档介绍:
分布式数据库中全局唯一主键生成策略的
设计与实现#
胡云亭,王晶**
5
10
(北京邮电大学网络技术研究院,北京,100876)
摘要:随着互联网的发展以及数据的爆炸式增长,集中式数据库已经无法满足海量数据快速
存储和查询的要求了,这时分布式数据库应运而生。分布式数据库是用计算机网络物理上分
散的多个数据库单元连接起来组成的一个逻辑上统一的数据库。分布式数据库使用全局唯一
主键从逻辑上保证其数据全局的唯一性。本文提出了一种新的生成全局唯一主键的策略,通
过建立主键生成服务器集群、使用 MYSQL 相关设置属性和一致性哈希来实现全局唯一主键生
成系统的可用性、容灾性和扩展性。此外,本文还通过实验数据来证明此策略的可用性、容
灾性和扩展性。
关键词:分布式数据库;MYSQL;一致性哈希;负载均衡
中图分类号:请查阅《中国图书馆分类法》
15
Design and Implementation of Global Unique Primary Key
Generation Strategy In Distributed Database System
HU Yunting, WANG Jing
(Beijing University of Posts and munications Institute of work, Beijing
20
25
100876)
Abstract: With the development of and the explosive growth of the data, centralized database
has been unable to meet the requirements of massive data storage and query quickly, and then
distributed database came into being. Distributed database is a logically unified database consist of
multiple databases dispersed units in physicals. In distributed database, the global unique primary key
guarantees the uniqueness of the data on the logic. This paper proposed a new generation strategy of
global unique primary key. Build generation server cluster and use MYSQL settings properties and
consistent hash to achieve availability, disaster recovery and scalability. Besides, confirm the
availability, disaster recovery and scalability of this strategy according to the experi