I am using SQLite with SQLAlchemy on a embedded linux system (think Raspberry Pi) to do some data logging.
The DB has a schema for configuration of sensors and adc boards. It has a measurement table which has columns for timestamp, value, adc_board_id (FK), channel_id (FK).
Measurements are saved to the DB every minute.
However I want to update an LCD with live measurements (every second).
The LCD app is a separate process and gets data to display from the DB.
Is there a way to have a table (a special table) just for live measurements that is only RAM based?
I want it accessible via the DB (like shared memory) but never to persist (i.e. never written to disk).
NOTE: I want most of the tables to persist on disk, but specify one (or more) special tables that never get written to disk.
Would that even work with separate processes accessing the DB?
The table will be written by only one process, but may be read by many processes, possibly via a View (once I learn how to do that with SQLAlchemy).
I did see some SQLite documentation that states:
The database in which the new table is created. Tables may be created in the main database, the temp database, or in any attached database.
Maybe using the temp database could do the trick?
Would it be accessible via other processes?
Alternatively, an attached database that lives on a ramdisk (/dev/shm/...
)?
Are there any other techniques with DBs/SQLite/SQLAlchemy to achieve the same outcome?