Hacker News new | ask | show | jobs
by skorgu 5862 days ago
I think Cassandra always writes to the Commit Log before returning success, it just doesn't update the SStables yet:

> Commit logs receive every write made to a Cassandra node and have the potential to block client operations [1]

I'm no expert so it may be possible to turn this off but I couldn't find reference to it.

[1] http://wiki.apache.org/cassandra/CassandraHardware

2 comments

I think Cassandra always writes to the Commit Log before returning success

Sure, but the write is not the significant part (it is likely to be cached in memory); the question is how often the commit log is sync'ed to disk. I'm no Cassandra expert, but I believe the default is to fsync() the commit log periodically, but to allow operations to return successfully before an fsync() has occurred. There's also a mode to require fsync() before returning success for an operation.

http://wiki.apache.org/cassandra/Durability

http://wiki.apache.org/cassandra/Durability

"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 ... You can also select "batch" mode, where Cassandra will guarantee that it syncs before acknowledging writes, i.e., fully durable mode"

Cassandra has very fine grained control over just about everything to do with consistency and durability. I believe you can pick your desired level of consistency at access time.