Oddbean new post about | logout
 Cool thing about nostrdb is that it is safe to  query it concurrently across threads. reads don’t require locks because of lmdb’s mmap + copy on write mechanism.

Most queries are fast enough to run on the main thread (0.01ms for pulling 10 notes), but it’s nice that you can safely offload queries to threads if you need to. Fulltext queries can sometimes take 70ms because of the compressed key index I’m using, so I leverage threads for those situations.