We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this questionWe need an in-memory data structure / DB server with following characteristics:
- stand-alone server: will run on the same machine as the clients, so any kind of IPC is ok
- sequential access:
get next/previous key
- two keys (string) per record: kind of a bi-directional map, actually
- in-memory only: should have option for no persistence at all
- RAM disk/tmpfs solution is not desirable
- SQL/ODBC is an option, although not required
- commercial product ok, if the OEM license price is reasonable
So far we have considered the following options, but no satisfactory solution yet:
- mysql: answers all requirements, but now answer yet as to how much an OEM license will cost
- memcached, cassandra: no sequential access, according to online docs
- Redis: seems as a nice tool, but again, I don't see get
get nex/prev
in the spec - Postgres: couldn't make it work well on Linux/ODBC
Seems that all nosql in-memory DBs provide only direct access by key, hash-table style. Have not checked Apache Derby yet.
We run on Linux, the client is in C++.
Will be glad to have your suggestions. Thanks!
EDIT: It seems that we will be pursuing the mysql option, we've got a reasonable price offer, and it will also be useful as our main (persistent) DB. Thanks for all answers, it is as usual difficult to select just one.
I'd have a look at SQLite, with the database file name set to ":memory:" this will create an in memory database that will no longer exist when your application closes.
It is public domain so that there is no issue with licensing
FastDB should work just fine. It supports in-memory configuration and shared access.
Redis doesn't sort keys, but it does have lists/sets which allow you to retrieve items in order. It's hard to know for sure if that would work without knowing why you want sequential access, but with NoSQL you often need to think a little differently about the data structures you use.
I'd suggest Kyoto Cabinet, it has an in memory function and sequential access.
edit: what's wrong with stl map?
精彩评论