memdb

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

README

MemDB Datastore Implementation

The memdb datastore implementation is based on Hashicorp's go-memdb library. Its implementation most closely mimics that of spanner, or crdb, where there is a single immutable datastore that supports querying at any point in time. The memdb datastore is used for validating and rapidly iterating on concepts from consumers of other datastores. It is 100% compliant with the datastore acceptance test suite and it should be possible to use it in place of any other datastore for development purposes. Differences between the memdb datastore and other implementations that manifest themselves as differences visible to the caller should be reported as bugs.

The memdb datastore can NOT be used in a production setting!

Implementation Caveats

No Garbage Collection

This implementation of the datastore has no garbage collection, meaning that memory usage will grow monotonically with mutations.

No Durable Storage

The memdb datastore, as its name implies, stores information entirely in memory, and therefore will lose all data when the host process terminates.

Cannot be used for multi-node dispatch

If you attempt to run SpiceDB with multi-node dispatch enabled using the memory datastore, each independent node will get a separate copy of the datastore, and you will end up very confused.

Documentation

Index

Constants

View Source
const DisableGC = time.Duration(math.MaxInt64)

DisableGC is a convenient constant for setting the garbage collection interval high enough that it will never run.

Variables

This section is empty.

Functions

func NewMemdbDatastore

func NewMemdbDatastore(
	watchBufferLength uint16,
	revisionQuantization,
	gcWindow time.Duration,
) (datastore.Datastore, error)

NewMemdbDatastore creates a new Datastore compliant datastore backed by memdb.

If the watchBufferLength value of 0 is set then a default value of 128 will be used.

Types

type TryLocker added in v1.8.0

type TryLocker interface {
	TryLock() bool
	Unlock()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL