Flash Caches

Log structured cache

Log structure cache uses a circular buffer, called a log. Data and metadata is written sequentially in it.

An object is buffered in DRAM. The buffer is considered full once we have a large enough flash to write. We write this complete set of objects in the log and also its metadata along with. The metadata has enough information that helps in finding that particular set, as it can be anywhere in the circular log. When a relevant set of objects is found, they are evicted altogether as a segment as they’re written in.

A huge advantage of using a log-structured cache is that we buffer our writes in DRAM and we have a very small overhead while writing to log. This way our buffered writes minimize the number of writes to flash and we don’t wear out our flash devices quickly. Though the disadvantage is that we have a full in-memory index.

An object can end up anywhere in the circular log on flash, so the full in-memory index becomes a huge problem when you have tiny objects.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy