I would like to know if there are any cache option available for SQLite.
The problem: I'm developing an application that runs on a low memory device that doesn't have much memory, and I don't want to rely on disk cache. I plan to READ the database very often, say every 50ms, and write every secund. I am afraid of flash wear out.
So my question is if there is any way to read the database from disk, and then copy it to the memory based database, and then write back to disk?
Or is there any other technique that can be used to prevent disk IO?
The inverse of the Sqlite3 CLI .save to „take from file into Memory“? But .read and .load have other functions!
Yes, there is backup() function that can copy DB from/to disk and memory.
- :memory: single thread DB - dies after close last connection
- file:db_name?mode=memory&cache=shared - cross thread DB, dies after process exits
Here is example in python3: https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.backup