Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for 
change notification.

The "Durability" page has been changed by JonathanEllis.
The comment on this change is: clean up fsync explanation.
http://wiki.apache.org/cassandra/Durability?action=diff&rev1=3&rev2=4

--------------------------------------------------

- Durability is the property that writes, once completed, will survive 
permanently, even if the server is killed or crashes or loses power.
+ Durability is the property that writes, once completed, will survive 
permanently, even if the server is killed or crashes or loses power.  This 
requires calling [[http://linux.die.net/man/2/fsync|fsync]] to tell the OS to 
flush its write-behind cache to disk.
  
- The naive way to provide durability is to write and 
[[http://linux.die.net/man/2/fsync|fsync]] your data files with each write, but 
this is prohibitively slow in practice because the disk needs to do random 
seeks to write the data to the write location on the physical platters.  
(Remember that each seek costs 5-10ms on rotational media.)
+ The naive way to provide durability is to fsync your data files with each 
write, but this is prohibitively slow in practice because the disk needs to do 
random seeks to write the data to the write location on the physical platters.  
(Remember that each seek costs 5-10ms on rotational media.)
  
- Like most modern systems, Cassandra provides durability by appending writes 
to a commitlog first.  This means that only the commitlog needs to be fsync'd, 
which, if the commitlog is on its own volume, obviates the need for seeking 
since the commitlog is append-only.  Implementation details are in 
ArchitectureCommitLog.
+ Instead, like other modern systems, Cassandra provides durability by 
appending writes to a commitlog first.  This means that only the commitlog 
needs to be fsync'd, which, if the commitlog is on its own volume, obviates the 
need for seeking since the commitlog is append-only.  Implementation details 
are in ArchitectureCommitLog.
  
  Cassandra's example configuration shows !CommitLogSync set to periodic, 
meaning that we sync the commitlog every CommitLogSyncPeriodInMS ms, so you can 
potentially lose up to that much data in a crash.  This is decently performant 
even with the commitlog shared with data directories.  You can also select 
"batch" mode, where Cassandra will guarantee that it syncs before acknowledging 
writes, i.e., fully durable mode, in batches of CommitLogSyncBatchWindowInMS.  
To use this mode we strongly recommend splitting your commitlog onto a separate 
device, as described above.
  
- Users familiar with PostgreSQL may wish to note that CommitLogSyncPeriodInMS 
and CommitLogSyncBatchWindowInMS correspond to the 
[[http://www.postgresql.org/docs/8.4/static/runtime-config-wal.html|PostgreSQL 
settings]] of wal_writer_delay and commit_delay, respectively.
+ Users familiar with PostgreSQL may note that CommitLogSyncPeriodInMS and 
CommitLogSyncBatchWindowInMS correspond to the 
[[http://www.postgresql.org/docs/8.4/static/runtime-config-wal.html|PostgreSQL 
settings]] of wal_writer_delay and commit_delay, respectively.
  

Reply via email to