This is what i have so far. I am almost done switching over my codebase to using this compact flatbuffers-style note representation. This will allow me to do make queries with no serialization overhead. Lots more work to do to build the indices and actual DB stuff, but getting there.
https://github.com/damus-io/nostrdb