Description
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.
Goals
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)
Something else?
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
More?
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?
Results:
- 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 (
msgpack
for 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 (
sed
orawk
etc). - 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
node
toinspector
. Finally... Sorry,node.js
guys. :-) - "YES" to all those questions in the section "Would it also?.."
- Unit tests are written.
Bonus features:
- 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.
No Hackers yet
Looking for hackers with the skills:
Nothing? Add some keywords!
This project is part of:
Hack Week 14
Comments
Be the first to comment!
Similar Projects
This project is one of its kind!