An Elixir wrapper for the Mnesia distributed database that simplifies table definition and provides an Enum-compatible interface.
Amnesia is an Elixir wrapper for the Erlang Mnesia distributed database system. It provides a simplified, macro-based interface for defining databases and tables, implements the Enumerable protocol for table iteration, and exposes all Mnesia functionality with full documentation and type specifications. It solves the problem of using Mnesia's Erlang-centric API directly in Elixir projects.
Elixir developers who need a distributed, transactional database and want to leverage Mnesia's capabilities without dealing with raw Erlang syntax.
Developers choose Amnesia because it makes Mnesia—a battle-tested distributed database—idiomatic in Elixir, with clean macros, Enum compatibility, and comprehensive documentation, reducing boilerplate and integration effort.
Mnesia wrapper for Elixir.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides defdatabase and deftable macros for clean schema definition, reducing the boilerplate of raw Mnesia Erlang syntax as shown in the README examples.
Implements Enumerable for tables, enabling direct use of Elixir's Enum functions for iteration and data manipulation, enhancing developer ergonomics.
Wraps all Mnesia features, including fragments and backups, with full documentation and type specs, even for undocumented parts, ensuring comprehensive access.
Includes amnesia.create and amnesia.drop tasks for straightforward schema management from the command line, simplifying database setup and teardown.
Most operations must be within transactions or use dirty alternatives, raising exceptions otherwise, which adds complexity and error-handling overhead as noted in the README.
Tightly couples to Erlang/OTP and Mnesia, limiting portability and making it unsuitable for projects needing integration with non-Erlang systems or databases.
Inherits Mnesia's limitations in handling very large datasets or high-throughput scenarios compared to specialized distributed databases, with no built-in sharding beyond fragments.