This content has been marked as final. Show 10 replies
user962305 wrote:Please see http://docs.oracle.com/cd/NOSQL/html/javadoc/oracle/kv/KVStore.html for information on the API including when/where you can use the Durability option. If you have more questions after reading through that, I'll be happy to answer them.
Please, can someone explain how does that durability option work?
Where and how can we set that option?
What are the aim and the benefit of that option?
Is that option available in the current version of Oracle NoSQL ?
In general, Durability is meant to allow the program to specify, on a per-operation basis, the level of durability for writes and updates.
Yes, it is available in all versions of Oracle NoSQL.
Edited by: Charles Lamb on Jan 6, 2012 9:02 AM
Excuse-me Charles, I was talking of the two dimensions of durability I read here
http://www.nocoug.org/download/2011-11/Marie-Anne_Neimat_NoSQL_Database.pdf page 21
It is written there that we can choose if we want to commit to RAM or commit to Disk.
I can not see any information on that flexibility any where? How and when can we choose that?
There are three elements of Durability: master sync policy, replica sync polcy, and replica ack policy. The first two specify the level of durability for a transaction's data on the master and replica, resp. The last part lets the user specify the number of replicas which must ack a transaction before it is ack'd to the user.
Sync policy (the first two elements of durability that I mentioned above) can be either no_sync (just write to the JVM memory), write_no_sync (just write to the OS but do not force to disk), or sync (force to disk). I believe this is what you were referring to. The javadoc that I (and Mark) referenced above has more details.
I am not sure I have understood sync policy.
Do not write or synchronously flush the log on transaction commit.
Write and synchronously flush the log on transaction commit.
Write but do not synchronously flush the log on transaction commit.
What do you mean by “flush the log”?
Where do you need to write apart form log file?
Are there a log file for current transactions and another file for committed transactions?
With write_no_sync, when do you decide to flush the log? When it is full?
With sync, if there is a crash why should we loose data if there are on disk even if there was no flush on the log?
There is only one log. NoSQL DB uses BDB Java Edition, which is an append-only storage system.
By "write" we mean issue a file system write. Such writes are not guaranteed to be durable, because the file system and hardware may buffer the data. An application (JVM) crash after a write will not cause data loss, but a system/OS crash may cause data loss.
By "synchronously flush" we mean issue a file system fsync. This pushes the data all the way to the storage device, so data loss will not occur even if there is a system/OS crash.
greybird wrote:To be even more specific, write means that the Java program (BDB JE) issues a RandomAccessFile.write() call which issues a write(2) call to the underlying file system. Hence, the data goes from the JVM to the OS. This protects against JVM failure, but not system failure.
Your previous post was correct so I'm going to repeat it:
NO_SYNC = no write, no fsync
WRITE_NO_SYNC = write, no fsync
SYNC = write and fsync
I think these names are historical and I can see how they are confusing.