Episteme.Database.Backends.Ets (Episteme v0.1.0)

Copy Markdown View Source

The default Episteme.Database.Backend: an in-memory :ets :set table keyed by {name, arity}, each row's value the predicate's own clause list -- so clause order (what backtracking order depends on) is exactly that Elixir list's order, never ETS's own unspecified multi-row traversal order. :public access, so any process holding the same Episteme.Database.t() value can read and mutate it, not just the process that called init/1 -- there is no coordination beyond what :ets itself serializes, so concurrent assert/retract against the same predicate from multiple processes can race (a read-modify-write on one row); concurrent access to different predicates never conflicts.

Table lifetime is tied to whichever process created it: like any ETS table, it is torn down automatically if that process dies, close/1 or not.