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 6 years ago.
Improve this questionI'm looking for a solution to add persistence to my native-code application. It should be simple (no SQL), fast, and most-importantly reliable.
The best approach I can think of i开发者_如何学Gos using memory-mapped files. It's as simple and fast as it can get - you simply store the values in plain-data arrays in "memory". However, I don't think it's very reliable - a power failure could leave the database in an inconsistent or corrupted state. Being able to transactionally sync a group of memory-mapped files to disk would solve this, but I don't think it's possible. Also, unless the filesystem supports snapshots or COW cloning (e.g. Brtfs), backups would mean having to stop the application completely while the files are being copied.
Does anyone have better ideas?
Tokyo Cabinet
http://fallabs.com/tokyocabinet/
Berkeley DB
http://www.oracle.com/technetwork/database/berkeleydb/overview/index.html
Your list of requirements sounds like Redis. See http://redis.io/ for more.
Another possibility is Cassandra. See http://cassandra.apache.org/ for more on that.
RocksDB or levelDB are other great options.
精彩评论