문제

I'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 is 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?

도움이 되었습니까?

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top