Check out this blog post by Mike Arpaia and Ted Reed about how osquery leverages RocksDB to build an embedded pub-sub system. This article is a great read and contains insights on how to properly use RocksDB.