Prepare for the Cassandra Test with flashcards and multiple-choice questions, each with detailed hints and explanations. Elevate your skills and excel in your exam!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What main function does the commit log serve in Cassandra?

  1. Logs data operations in RAM

  2. Stores data in an append-only format

  3. Facilitates real-time data processing

  4. Acts as a cache for frequently accessed data

The correct answer is: Stores data in an append-only format

The commit log serves a crucial role in Cassandra as it is responsible for ensuring durability and reliability of the data. Its primary function is to store data in an append-only format. This means that every write operation is recorded sequentially in the commit log before it is processed and written to its final location in the SSTables. This append-only format is beneficial because it allows for quick writes and also provides a reliable mechanism for recovering data in the event of a failure. During write operations, data is first appended to the commit log, which guarantees that even if there is a power failure or crash, the data can be recovered from the log, maintaining data integrity. Once the data is safely recorded in the commit log, it can later be flushed to disk and structured into SSTables, which allows for efficient read and storage operations. The other options do not accurately reflect the primary function of the commit log: - Logging data operations in RAM doesn't capture the essence of the commit log's function; instead, it operates in persistent storage. - While the commit log can facilitate data processing, it is not primarily designed for real-time processing; its main role is to provide durability. - Acting as a cache implies temporary storage for fast access, which is not the function of