Journal of East China Normal University(Natural Science) ›› 2021, Vol. 2021 ›› Issue (6): 124-134.doi: 10.3969/j.issn.1000-5641.2021.06.013

• Computer Science • Previous Articles     Next Articles

SQLite-CC based on non-volatile memory cache

Yaoyi HU, Huiqi HU*(), Xuan ZHOU, Aoying ZHOU   

  1. School of Data Science and Engineering, East China Normal University, Shanghai 200062, China
  • Received:2020-08-31 Online:2021-11-25 Published:2021-11-26
  • Contact: Huiqi HU E-mail:hqhu@dase.ecnu.edu.cn

Abstract:

In recent years, non-volatile memory (NVM) has developed rapidly. Its advantages, among others, include: persistence, large capacity, low latency, byte addressing, high density, and low energy consumption — all of which have impacted current database system architecture. SQLite is a lightweight relational database widely used in embedded fields such as mobile platforms. It operates as a serverless, zero-configuration, transactional SQL database engine. It maintains a cache for each connection, which results in problems with large space overhead and data consistency detection. At the same time, it adopts a relatively simple serialized single-write transaction execution method and page-based logging, which offers low performance and write amplification in the journal mode and a storage space requirement in the WAL mode during execution. In order to address the above challenges, a new scheme of SQLite Cache based on non-volatile memory, SQLite-CC (Copy Cache), is constructed, which fully considers the hardware characteristics of non-volatile memory and ensures the atomicity of transactions using a CC-manager and by adding an updated page index to ensure the consistency of database files and cache. Benchmarking tests show that it can achieve the same concurrency performance as SQLite-WAL mode. Compared with the rollback mode, it improves the execution performance of transactions by 3 times, reduces latency by 40%, and effectively solves the issue of write amplification on disks.

Key words: NVM, SQLite, cache optimization, logging solution

CLC Number: