FlashDB
FlashDB 是一款超轻量级的嵌入式数据库,专注于提供嵌入式产品的数据存储方案。与传统的基于文件系统的数据库不同,FlashDB 结合了 Flash 的特性,具有较强的性能及可靠性。并在保证极低的资源占用前提下,尽可能延长 Flash 使用寿命。FlashDB 提供两种数据库模式: - 键值数据库 :是一种非关系数据库,它将数据存储为键值(Key-Value)对集合,其中键作为唯一标识符。KVDB 操作简洁,可扩展性强。 - 时序数据库 :时间序列数据库 (Time Series Database , 简称 TSDB),它将数据按照 时间顺序存储 。TSDB 1. 资源占用极低,内存占用几乎为 0 ; 2. 支持 多分区,多实例 。数据量大时,可细化分区,降低检索时间; 3. 支持 磨损平衡 ,延长 Flash 寿命; 4. 支持 掉电保护 功能,可靠性高; 5. 支持 字符串及 blob 两种 KV 类型,方便用户操作; 6. 支持 KV 增量升级 ,产品固件升级后, KVDB 内容也支持自动升级; 7. 支持 修改每条 TSDB 记录的状态,方便用户进行管理;
Install / Use
/learn @wuzhl2018/FlashDBREADME

EN | 中文
Introduction
FlashDB is an ultra-lightweight embedded database that focuses on providing data storage solutions for embedded products. Different from traditional database based on file system, FlashDB combines the features of Flash and has strong performance and reliability. And under the premise of ensuring extremely low resource occupation, the service life of Flash should be extended as much as possible.
FlashDB provides two database modes:
- Key-value database: It is a non-relational database that stores data as a collection of key-value pairs, where the key is used as a unique identifier. KVDB has simple operation and strong scalability.
- Time Series Database: Time Series Database (TSDB), which stores data in time sequence. TSDB data has a timestamp, a large amount of data storage, and high insertion and query performance.
Usage scenario
Nowadays, there are more and more types of IoT products, and the types and total amount of data generated during operation are also increasing. FlashDB provides a variety of data storage solutions, not only has a small resource footprint, but also has a large storage capacity, which is very suitable for IoT products. The following are the main application scenarios:
- Key-value database:
- Product parameter storage
- User configuration information storage
- Small file management
- Time Series Database:
- Store dynamically generated structured data: such as environmental monitoring information collected by temperature and humidity sensors, human health information recorded in real time by smart bracelets, etc.
- Record operation log: store operation log of product history, record of abnormal alarm, etc.
Key Features
- Very small footprint, ram usage is almost 0;
- Support multiple partitions, multiple instances. When the amount of data is large, the partition can be refined to reduce the retrieval time;
- Support wear balance to extend Flash life;
- Support Power-off protection function, high reliability;
- Supports two KV types, string and blob, which is convenient for users to operate;
- Support KV incremental upgrade, after product firmware upgrade, KVDB content also supports automatic upgrade;
- Support to modify the status of each TSDB record to facilitate user management;
Performance and footprint
TSDB performance test 1 (nor flash W25Q64)
msh />tsl bench
Append 1250 TSL in 5 seconds, average: 250.00 tsl/S, 4.00 ms/per
Query total spent 2218 (ms) for 1251 TSL, min 1, max 2, average: 1.77 ms/per
Insert average: 4 ms, query average: 1.8 ms
TSDB performance test 2 (stm32f2 onchip flash)
msh />tsl bench
Append 13421 TSL in 5 seconds, average: 2684.20 tsl/S, 0.37 ms/per
Query total spent 1475 (ms) for 13422 TSL, min 0, max 1, average: 0.11 ms/per
Insert average: 0.37 ms, query average: 0.12 ms
Footprint (stm32f4 IAR8.20)
Module ro code ro data rw data
------ ------- ------- -------
fdb.o 276 232 1
fdb_kvdb.o 4 584 356 1
fdb_tsdb.o 1 160 236
fdb_utils.o 418 1 024
The above is the map file information of IAR. It can be seen that the footprint of FlashDB is very small.
How to use
FlashDB provides comprehensive documentation, see: https://armink.github.io/FlashDB/#/
Quick access:
License
The project uses the Apache-2.0 open source protocol. For details, please read the contents of the LICENSE file in the project.
Related Skills
feishu-drive
338.7k|
things-mac
338.7kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
338.7kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
yu-ai-agent
1.9k编程导航 2025 年 AI 开发实战新项目,基于 Spring Boot 3 + Java 21 + Spring AI 构建 AI 恋爱大师应用和 ReAct 模式自主规划智能体YuManus,覆盖 AI 大模型接入、Spring AI 核心特性、Prompt 工程和优化、RAG 检索增强、向量数据库、Tool Calling 工具调用、MCP 模型上下文协议、AI Agent 开发(Manas Java 实现)、Cursor AI 工具等核心知识。用一套教程将程序员必知必会的 AI 技术一网打尽,帮你成为 AI 时代企业的香饽饽,给你的简历和求职大幅增加竞争力。
