Olimex Support Forum

Microcontrollers => ESP32 => Topic started by: yurka on March 08, 2024, 11:12:45 AM

Title: SDCARD or SPIFF for BBDD
Post by: yurka on March 08, 2024, 11:12:45 AM
Hoal to all! 8)

I have the need to use BBDD (database) to be able to work in OFFLINE.
Information is very poor and simple {key,value}.

Does anyone know where is better to put in SDCARD, SPIFFS Filesystem or other place.

Thanks
Title: Re: SDCARD or SPIFF for BBDD
Post by: LubOlimex on March 08, 2024, 01:17:07 PM
You can store in the flash memory or in the sd card. I believe SPIFFS is not the best. Best idea is to search online for  this string - "storage esp32" you will find many useful forum threads and options and experience.
Title: Re: SDCARD or SPIFF for BBDD
Post by: yurka on March 08, 2024, 02:16:21 PM
Hello @LubOlimex thank you very much for your quick answer,
as you can see the need I have is OFFLINE, without internet minimum 30-200 records +/- 13bytes/register

I have thought about creating a txt file and making "appened". then once it reaches a measurement, it will be overwritten in SPIFFS.

But I would like to hear opinions and experiences of people :)
Title: Re: SDCARD or SPIFF for BBDD
Post by: KeviNH on March 10, 2024, 04:35:10 AM
SPIFFS is deprecated and may be retired soon, and for a number of reasons is not recommended for storing a large number of very small files.

If you need to store short values, consider storing the data in NVS (aka "Preferences (https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/api/preferences.html)").  It is designed to store many small values in flash.

For a fully offline device, could pre-fill the cache via the NVS Partition Generator Utility (https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/storage/nvs_partition_gen.html).
Title: Re: SDCARD or SPIFF for BBDD
Post by: yurka on March 11, 2024, 10:52:10 AM
hmmm, storing directly in the FLASH, I will look into it, I mean just storing 50 - 200 12byte records. That's enough.

Thank you and very kind!



Quote from: KeviNH on March 10, 2024, 04:35:10 AMSPIFFS is deprecated and may be retired soon, and for a number of reasons is not recommended for storing a large number of very small files.

If you need to store short values, consider storing the data in NVS (aka "Preferences (https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/api/preferences.html)").  It is designed to store many small values in flash.

For a fully offline device, could pre-fill the cache via the NVS Partition Generator Utility (https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/storage/nvs_partition_gen.html).