Persistence

Ohmoc uses rlite for query and storage. rlite implements a redis-compatible API as a library.

Internally, the database persists as a single file. To ensure integrity a second file (write-ahead log) is written before writing, but deleted after. If the process crashes during the operation and the wal file was fully written, the operation will be applied the next time the database is used. If it failed while writing the wal, it will be discarded.

Every time a write operation returns, the changes are already fsync'd to the file system, meaning the database is ACID.

Before using Ohmoc, an instance has to be created. If no path is specified, it will not persist and will only used memory.