有这样一个需求:配置数据,以string type key value pair存储,如 ip = 192.168.0.100。为了多个进程共享配置数据,配置数据在启动解析一次后,以特定的数据结构体存储到shared memory中。配置数据可以新增,删除,修改。查找应该高效。
googling解决方案:
hash map
B+ tree
开源方案
https://en.wikipedia.org/wiki/Lightning_Memory-Mapped_Database
https://mozilla.github.io/firefox-browser-architecture/text/0015-rkv.html
https://github.com/simonhf/sharedhashfile