How to apply a key value store database in an embedded product

Source: Internet
Author: User
Tags value store

"Disclaimer: Copyright, please reprint, do not use for commercial purposes." Contact box: armink.ztl@gmail.com " 1, background

With the rapid development of Internet and the arrival of large data age, NoSQL database has been fully developed with its strong scalability, high efficiency and real-time characteristics. Key value (key-value) storage database is one of the NoSQL, the famous Redis is a development of the open source with C key value to the storage database.

At the same time, more and more manufacturers have joined the IoT products, wearable equipment, smart home embedded product development ranks, the data of the persistent storage needs become more and more, the selection of a good scalability, small footprint, high stability, and can be applied to the embedded products of the persistent repository is becoming more and more important. 2, Easyflash

Easyflash is an open source lightweight embedded flash memory library, mainly for the MCU to provide a convenient, general-purpose upper application interface, it provides 3 main functions: ENV (environment variable), IAP (online upgrade) and log (Flash storage log). Here is a description of the Env feature that lets Flash become a small key-value storage database. 3, the increase of the deletion check

The following illustration shows a common interface for invoking environment variables through a console (terminal), demonstrating the process of environment variable "temp" from creation to save, then modify, and finally delete. These interfaces support direct invocation by the application tier.

The API for Easyflash environment variable functionality is located in the https://github.com/armink/easyflash/blob/master/docs/zh/api.md#12-environment variable
The main use methods are as follows:

* Create the environment variable with key named Temp, and assign the initial value "123"
/ef_set_env ("temp", "123");
/* Modify environment variable temp value is "456" * *
ef_set_env ("temp", "456");
/* Read environment variable TEMP value *
/char *temp = ef_get_env ("temp");
/* DELETE environment variable temp *
/ef_set_env ("temp", "");
4, the use of the scene

At present, the author has applied Easyflash products, the main storage of the following content 1, the operation of the electrical parameters of the product 2, the operation of the record 3, user-editable parameters, 4, software assertions and hardware anomalies such as the system crash log, 5, online upgrade bootloader and app interaction between the parameters; 6, More storage content to be explored ... 5, Demo

Currently ported hardware platform has stm32f10x and STM32F4XX series of in-chip flash as well as external SPI flash, and support bare-metal and rt-thread embedded operating system. Welcome to the Star and pull request, and provide more platform support and advice.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.