Salt Inspector, formerly known as "Salt Node" is running an SQLite under the hood in order to buffer query results that usually taking time. After a while using this, the SQLite appears to be a quite overhead for this task as well as asking for an additional maintainable dependency.
The idea is to remove it and replace with some sort of simple object storage that mainly does only two things efficiently:
- Stores objects
- Retrieves objects
- (2a) Does update/delete but within "nice to have" scope (can be inefficient as not needed for many objects)
Additionally, this cache could:
- Store data in some sort of a plain text
- Provide an easy fast intersection between the versions for retrieving a difference
Would it also:
- Shrink the code a bit?
- Remove those u̶g̶l̶y̶ not beautiful SQL queries from within the code?
- Work only with Python objects? Directly?
- Have a very small codebase?
- Storage can serialize a Python objects and store it to the CSV file (comma separated values) and work on it while it is compressed (GNU Zip)
- Storage get retrieve a Python objects from such CSV file
- Data is smaller than would be stored in a binary form (
msgpackfor example). The binary form storing would require object-per-file (bad idea) or maintain own binary format to read records (bad idea again).
- Data can be processed with any other tools (
- Is as fast as before.
- Storage is based on time-proven CSV module, which is since Python 2.3 or 13 years old, and is widely used since.
- Renamed from
inspector. Finally... Sorry,
- "YES" to all those questions in the section "Would it also?.."
- Unit tests are written.
- Treating each inspection full scanning as a snapshot. For this implemented listing and deleting of such snapshots.
- Started working on diff'ing data between the snapshots (not upstream yet).
Pull request on Github/Salstack is here.
This project is one of its kind!