Ok Ive been toying with a similar implementation but this one is all in ram, doesn’t touch disk. Can store about 3-6 million notes easily
Discussion
when you use something like lmdb you can let the OS reclaim old pages when under memory pressure. so its a bit nicer and you don't have to worry about the size of the database