SQLite Forum

Multithread processing, storing in memory and writing to database
Login
[RRDTool](https://en.wikipedia.org/wiki/RRDtool) matches pretty well with those criteria, and was designed pretty much exactly for the OP's sort of problem.