Grove.Storage.ETS (Grove v0.1.1)
View SourceIn-memory ETS storage backend for CRDTs.
Fast storage using Erlang Term Storage (ETS). Data is lost on node restart.
Use Grove.Storage.DETS for persistent storage.
Features
- Microsecond read/write latency
- Concurrent read/write access
- Named tables for easy access
Usage
{:ok, ref} = Grove.Storage.ETS.init(table: :my_crdts)
# Save a CRDT
:ok = Grove.Storage.ETS.save(ref, {:counter, "views"}, crdt_state)
# Load a CRDT
{:ok, crdt_state} = Grove.Storage.ETS.load(ref, {:counter, "views"})Options
:table- Table name (default::grove_ets_storage)
Summary
Functions
Deletes the ETS table entirely.
Functions
@spec destroy(atom()) :: :ok
Deletes the ETS table entirely.
This is useful for cleanup in tests.