数据库 - 大约50个键值对存储(需要方便C++接口读写,多次同时读取)
怪我咯
怪我咯 2017-04-17 11:03:21
0
2
560

我现在想存50来个键值对,内容比较少,所以不想用MYSQL这样的数据库,我需要多次同时读取里面的值,最好便于查找,比如我要读第21个键值对,而且要能承受多次反复的读取,我的意思是强度挺大,现在想到的方法是CVS,XML,不知还有其他方法吗,如果有,请给出具体建议,非常感谢,需要有C++接口。 SQLITE我也试过,但不知它是否能承受多次同时查询?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(2)
PHPzhong

If the amount of data is so small, as OpenFibers said, you can consider storing it directly in the memory, but your difficulty is probably what type of key is this key-value and whether multiple programs need to read it at the same time. If it is a basic type Of course, you can just use map directly. If it is not a basic type, you can provide a hash algorithm to calculate a unique index for this key, and then use this index to create a map, which should also meet the requirements. If you want multiple processes to read, you can consider using shared memory to save data and synchronize control of write operations. Don't feel the need to use SQLite etc.

黄舟

Just put STL into the memory

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template