{"id":23658890,"url":"https://github.com/mustafaturan/mnesiam","last_synced_at":"2025-09-01T12:31:38.981Z","repository":{"id":57528889,"uuid":"88793224","full_name":"mustafaturan/mnesiam","owner":"mustafaturan","description":"Mnesiam makes clustering easy for Mnesia database.","archived":false,"fork":false,"pushed_at":"2021-01-13T06:36:42.000Z","size":9,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-18T18:40:24.648Z","etag":null,"topics":["cluster","elixir","mnesia"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mustafaturan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-19T21:38:50.000Z","updated_at":"2025-03-25T21:36:44.000Z","dependencies_parsed_at":"2022-09-10T18:31:57.481Z","dependency_job_id":null,"html_url":"https://github.com/mustafaturan/mnesiam","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mustafaturan/mnesiam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafaturan%2Fmnesiam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafaturan%2Fmnesiam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafaturan%2Fmnesiam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafaturan%2Fmnesiam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mustafaturan","download_url":"https://codeload.github.com/mustafaturan/mnesiam/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafaturan%2Fmnesiam/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273122203,"owners_count":25049540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cluster","elixir","mnesia"],"created_at":"2024-12-29T01:03:08.891Z","updated_at":"2025-09-01T12:31:38.660Z","avatar_url":"https://github.com/mustafaturan.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# THIS LIBRARY IS DEPRECATED IN FAVOR OF ACTIVE DEVELOPMENT AT [mnesiac LIBRARY](https://hex.pm/packages/mnesiac)([Github](https://github.com/beardedeagle/mnesiac)).\n\n# Mnesiam\n\nMnesiam makes clustering easy for Mnesia database.\n\nThe module docs can be found at [https://hexdocs.pm/mnesiam](https://hexdocs.pm/mnesiam).\n\n## Installation\n\nThe package can be installed by adding `mnesiam` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:mnesiam, \"~\u003e 0.1.1\"}]\nend\n```\n\nEnsure `mnesiam` is started before your application.\n\nElixir Version \u003e= 1.4 with `libcluster`\n\n```elixir\ndef application do\n  [extra_applications: [:libcluster, :mnesiam]]\nend\n```\n\nElixir Version \u003e= 1.4 without `libcluster`\n\n```elixir\ndef application do\n  [extra_applications: [:mnesiam]]\nend\n```\n\nEdit your app's `config.exs` to add list of mnesia stores:\n\n```elixir\nconfig :mnesiam,\n  stores: [Mnesiam.Support.SampleStore, ...],\n  table_load_timeout: 600_000 # milliseconds\n```\n\n## Usage\n\n### Table creation\n\nCreate a table store and add it to your app's config.exs. Note: All stores *MUST* implement its own `init_store/0` to create table and `copy_store/0` to copy table:\n\n```elixir\ndefmodule Mnesiam.Support.SampleStore do\n  @moduledoc \"\"\"\n  Sample store implementation\n  \"\"\"\n\n  alias :mnesia, as: Mnesia\n\n  @table :sample_store\n\n  @doc \"\"\"\n  Mnesiam will call this method to init table\n  \"\"\"\n  def init_store do\n    Mnesia.create_table(@table,\n      [ram_copies: [Node.self()], attributes: [:id, :topic_id, :event]])\n    # Sample index\n    Mnesia.add_table_index(@table, :topic_id)\n    # Add table subscriptions to here\n    # ...\n  end\n\n  @doc \"\"\"\n  Mnesiam will call this method to copy table\n  \"\"\"\n  def copy_store do\n    Mnesia.add_table_copy(@table, Node.self(), :ram_copies)\n  end\nend\n\n```\n\n### Clustering\n\nIf you are using `libcluster` or another clustering library just ensure that clustering library starts earlier than `mneasiam`. That's all, you do not need to do rest.\n\nIf you are not using `libcluster` or similar clustering library then:\n\n- When a node joins to an erlang/elixir cluster, run `Mnesiam.init_mnesia()` function on the *new node*; this will init and copy table contents from other online nodes.\n\nEnjoy!\n\n## Contributing\n\nFor any issues, bugs, documentation, enhancements:\n\n1) Fork the project\n\n2) Make your improvements and write your tests.\n\n3) Make a pull request.\n\n## License\n\nApache License 2.0\n\nCopyright (c) 2018 Mustafa Turan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmustafaturan%2Fmnesiam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmustafaturan%2Fmnesiam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmustafaturan%2Fmnesiam/lists"}