>>francz+(OP)
Brilliant. This reminds me of (but is way more advanced) a single-file Python NoSQL key-value DB that used pickling to store data. It was FAST. Can't remember what happened to it. Anybody?
>>surfin+yii
I wrote something similiar (minimal nosql key-value DB) and it was less fast than (specifically lower throughput, I did not measure other metrics) Redis, despite some passing attempts to make it fast (like using async/await for all IO).