华东师范大学学报(自然科学版) ›› 2019, Vol. 2019 ›› Issue (5): 143-158.doi: 10.3969/j.issn.1000-5641.2019.05.012

• 新时期数据管理技术 • 上一篇    下一篇

面向日志结构化数据存储的高效数据加载

丁国浩, 徐辰, 钱卫宁   

  1. 华东师范大学 数据科学与工程学院, 上海 200062
  • 收稿日期:2019-07-28 出版日期:2019-09-25 发布日期:2019-10-11
  • 通讯作者: 徐辰,男,副教授,研究方向为大规模分布式数据管理系统.E-mail:cxu@dase.ecnu.edu.cn. E-mail:cxu@dase.ecnu.edu.cn
  • 作者简介:丁国浩,男,硕士研究生,研究方向为分布式数据管理系统.E-mail:guohao.ding@outlook.com.
  • 基金资助:
    国家重点研发计划(2018YFB1003400);上海市青年科技英才扬帆计划(19YF1414200)

Efficient data loading for log-structured data stores

DING Guo-hao, XU Chen, QIAN Wei-ning   

  1. School of Data Science and Engineering, East China Normal University, Shanghai 200062, China
  • Received:2019-07-28 Online:2019-09-25 Published:2019-10-11

摘要: 近年来,随着互联网技术的快速发展,无论是互联网企业还是传统的金融机构,用户量和业务处理数据量都在快速地增长.传统的通过增加服务器并采用基于分库分表的方法来解决扩展性问题,需要大量的人工维护成本和硬件开销.为降低开销和分库分表带来的各种问题,业界通常用新型数据库系统替换原有的系统,其中,基于日志结构合并树存储的数据库系统(如OceanBase)被广泛采用,这类系统磁盘上存储数据块呈现全局有序的特征.在从传统数据库切换到新型数据库过程中,需要将大量数据加载到新数据库系统中,长时间加载的过程中可能出现数据库节点宕机.为了减少总加载时间和故障恢复时间,提出了一种负载均衡且支持高效容错的数据加载方法;为了支持负载均衡的数据加载,与预确定分区划分数据的方法不同,考虑到目标系统默认存储块大小,采用通过基于文件大小和目标系统默认存储块大小预计算分区数目,并利用分库分表的数据导出往往已经排序的特点,采用选取部分采样块和等间隔选取样本的方式确定分区之间的切分点,避免了全局采样和随机或头部样本选取方式确定切分点带来的高开销;为了加快故障恢复速度,利用日志结构合并树存储系统的多备份减少故障恢复时的数据量,提出了基本副本局部故障恢复方式,避免了完全重新加载的故障恢复方式.实验结果表明,相比采用预确定分区数目和全局选取采样块的随机或头部选取样本方法,采用预计算分区数目和部分选取采样块的等间隔选取样本确定切分点的方法,提高了数据加载的性能,并且验证了基于副本局部故障恢复方法相比完全重启加载恢复方法的高效性.

关键词: 数据加载, 负载均衡, 容错, 日志结构

Abstract: With the rapid development of Internet technology in recent years, the number of users and the data processed by Internet companies and traditional financial institutions are growing rapidly. Traditionally, businesses have tackled this scalability problem by adding servers and adopting methods based on database sharding; however, this can lead to significant manual maintenance expenses and hardware overhead. To reduce overhead and the problems caused by database sharding, businesses commonly replace heritage equipment with new database systems. In this context, new databases based on log-structured merge tree storage (such as OceanBase) are being widely used; the data blocks stored on the disks of such systems exhibit global orderly features. In the process of switching from a traditional database to a new database, a large amount of data must be transferred, and database node downtime may occur when there is extended loading. In order to reduce the total time for loading and failure recovery, we propose a data loading method that supports load balancing and efficient fault tolerance. To support balanced data loading, we pre-calculate the number of partitions based on the file size and the default block size of a target system rather than using a pre-determined number of partitions. In addition, we use the feature that the data exported from the sharding database is usually sorted to determine the split points between partitions by selecting partial sampling blocks and selecting samples in sampling blocks at equal intervals, avoiding the high overhead caused by global sampling and selecting samples randomly or at the head in sampling blocks. To speed up the recovery process, we propose a replica-based partial recovery to avoid restart-based complete reloading; this method uses the multi-replica of an LSM-tree system to reduce the amount of reloaded data. Experimental results show that by pre-calculating the number of partitions and partial sampling blocks and by using equal-interval sampling, we can accelerate data loading relative to pre-determining the number of partitions and global sampling blocks as well as relative to random or head sampling strategies. Hence, we demonstrate the efficiency of replica-based partial failure recovery compared to restart-based complete reloading.

Key words: data loading, load balance, fault tolerance, log-structured

中图分类号: