# `Slap.SlateDB.Cache`
[🔗](https://github.com/mjrusso/slap/blob/slap_slatedb-v0.2.0/slap_slatedb/lib/slap/slatedb/cache.ex#L1)

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.

# `t`

```elixir
@opaque t()
```

# `new`

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

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
