A row cache is an in-memory, read-through cache that keeps rows obtained from disk reads. When a later query needs a previously read row, it can often be served from the cache instead of requiring disk I/O. section 7.2.2 section 8.3.1
Disk I/O is one of the slowest low-level operations during a read. Rows can be spread across on-disk SSTables after writes and updates, so caching previously read rows helps reduce the cost of frequently repeated queries. section 7.2.2 section 8.3.1
Place the row cache among the main read and write components on a node:
- Writes enter a memtable and commit log before being flushed into SSTables on disk. section 8.3.1
- Reads check in-memory and on-disk structures for current row versions; the row cache helps speed these reads. section 7.4
- Each CPU-core shard has its own row cache, memtable, commit log, and SSTables. section 8.3.2
Figure 8.11 Scylla’s row cache stores rows obtained by reading SSTables in response to a query.
The figure traces the cache’s input: rows read from SSTables in response to a query are stored for later reads. section 8.3.1
