Slap.SlateDB.Cache (slap_slatedb v0.2.0)

Copy Markdown View Source

An in-memory block and metadata cache that several databases can share.

cache = Slap.SlateDB.Cache.new(512 * 1024 * 1024)
{:ok, a} = Slap.SlateDB.open("a", store: store, cache: cache)
{:ok, b} = Slap.SlateDB.open("b", store: store, cache: cache)

The databases compete for one memory budget instead of each having its own. SlateDB keeps each database's entries apart, so they cannot see each other's blocks. Without a :cache option, each database gets its own default cache.

Summary

Functions

Creates a cache that holds up to capacity_bytes of blocks and metadata.

Types

t()

@opaque t()

Functions

new(capacity_bytes)

@spec new(pos_integer()) :: t()

Creates a cache that holds up to capacity_bytes of blocks and metadata.