| 摘要: |
| 随着近年来嵌入式应用的复杂化和多样化,工业界和学术界提出来用内存数据库满足嵌入式系统对数据处理性能不断提升的要求.然而,现有的内存数据库需要在磁盘或闪存等外存上持久化存储真实的数据库备份,并且以I/O操作的方式将数据库的更新操作同步回外存,有极大的性能开销.此外,这类数据库即便直接部署在新型非易失性内存(non-volatile memory,简称NVM)中,也因为缺乏内存中的持久化机制而不能脱离外存.针对现有内存数据库的不足,提出一套面向NVM的持久化内存数据库设计方案.该方案直接用数据库独立管理NVM,持久化存储NVM的空间信息以及内存数据库的元数据.依据该方案,在典型的内存数据库Redis的基础上实现了可在NVM上持久化的内存数据库.实验结果表明,该方案与既有Redis的持久化方案AOF相比,数据库的启动速度可提高2 400倍,关闭速度可提高5倍,set操作的速度可提高58倍,delete操作的速度可提升34倍. |
| 关键词: 内存数据库 非易失性内存 持久化 嵌入式数据库 性能优化 |
| DOI: |
| 分类号: |
| 基金项目:国家高技术研究发展计划(863)(2015AA015304);国家自然科学基金(61472052);重庆市科技攻关项目(cstc2014yykfB40007) |
|
| Design of Persistent Embedded Main Memory Databases on Non-Volatile Memory |
|
Edwin H.-M. SHA1,2, CHEN Xian-Zhang1, MA Dian-Long1, ZHUGE Qing-Feng1,2
|
|
1.College of Computer Science, Chongqing University, Chongqing 400044, China;2.Key Laboratory of Dependable Service Computing in Cyber Physical Society, Ministry of Education(Chongqing University), Chongqing 400044, China
|
| Abstract: |
| With the increasing complication and variation of embedded applications in recent decades, both industry and academia have been proposing to use main memory databases to meet the ever-growing demand of high-performance data processing in embedded systems. Nevertheless, the existing main memory databases all rely on the secondary storage, such as magnetic disks and SSD, to maintain the real database persistently. Moreover, they have large overhead in synchronizing the data between memory and storage via slow I/O operations. Even though they are deployed in the emerging Non-Volatile Memory (NVM), the existing main memory databases are unable to get rid of disks for their temporary in-memory data structures cannot survive system reboot. In solving the persistency problem of main memory databases, this paper proposes to manage the NVM by the database itself that is independent from the memory management system. The information of NVM and the metadata of the database are persistently fixed on the NVM. The proposed ideas are implemented in an open-sourced main memory database, Redis. The experimental results show that compared with the existing persistency scheme of Redis AOF, the proposed approach improves the speeds of starting database, closing database, set operations, and delete operations by 2400 times, 5 times, 58 times, and 34 times, respectively. |
| Key words: main memory database non-volatile memory persistence embedded database performance optimization |