All Projects → mustafaturan → mnesiam

mustafaturan / mnesiam

Licence: other
Mnesiam makes clustering easy for Mnesia database.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to mnesiam

akka-cluster-minimal
Akka Cluster - absolute minimal
Stars: ✭ 16 (-5.88%)
Mutual labels:  cluster
pg-dock
pg-dock cluster managment
Stars: ✭ 19 (+11.76%)
Mutual labels:  cluster
impress-cli
Impress Application Server Command line interface
Stars: ✭ 25 (+47.06%)
Mutual labels:  cluster
provisionr
📦📦➡️🏛️ Provision a library of R packages
Stars: ✭ 26 (+52.94%)
Mutual labels:  cluster
ClusterAnalysis.jl
Cluster Algorithms from Scratch with Julia Lang. (K-Means and DBSCAN)
Stars: ✭ 22 (+29.41%)
Mutual labels:  cluster
kubectl-node-restart
Krew plugin to restart Kubernetes Nodes sequentially and gracefully
Stars: ✭ 73 (+329.41%)
Mutual labels:  cluster
blacksmith
Bare-Metal CoreOS Cluster Manager
Stars: ✭ 67 (+294.12%)
Mutual labels:  cluster
gce-cache-cluster
Easy groupcache clustering on GCE
Stars: ✭ 32 (+88.24%)
Mutual labels:  cluster
proxmox-tools
📦 A collection of stuff that I and others wrote for Proxmox 📦
Stars: ✭ 112 (+558.82%)
Mutual labels:  cluster
webpack-cluster
Helps to make parallel webpack compilation easily
Stars: ✭ 32 (+88.24%)
Mutual labels:  cluster
gpu-cluster-config
How to Configure a GPU Cluster Running Ubuntu Linux
Stars: ✭ 45 (+164.71%)
Mutual labels:  cluster
laravel-php-k8s
Just a simple port of renoki-co/php-k8s for easier access in Laravel
Stars: ✭ 71 (+317.65%)
Mutual labels:  cluster
node-advanced
Node Advanced Courseware
Stars: ✭ 80 (+370.59%)
Mutual labels:  cluster
flask-docker-compose
Flask application development skeleton with docker-compose
Stars: ✭ 22 (+29.41%)
Mutual labels:  cluster
koinos
Official home of the Koinos Blockchain. Use this umbrella repository to launch a Koinos cluster using Docker.
Stars: ✭ 24 (+41.18%)
Mutual labels:  cluster
xoom-cluster
The VLINGO XOOM platform SDK cluster management for Reactive, scalable resiliency of JVM tools and applications running on XOOM LATTICE and XOOM ACTORS.
Stars: ✭ 25 (+47.06%)
Mutual labels:  cluster
ClusterMonitor
Very simple script which logs the CPU and RAM usage of the submitted job.
Stars: ✭ 23 (+35.29%)
Mutual labels:  cluster
dentist
Close assembly gaps using long-reads at high accuracy.
Stars: ✭ 39 (+129.41%)
Mutual labels:  cluster
terraform-aws-druid
Terraform module to deploy Apache Druid in Kubernetes
Stars: ✭ 16 (-5.88%)
Mutual labels:  cluster
Clustering-Datasets
This repository contains the collection of UCI (real-life) datasets and Synthetic (artificial) datasets (with cluster labels and MATLAB files) ready to use with clustering algorithms.
Stars: ✭ 189 (+1011.76%)
Mutual labels:  cluster

THIS LIBRARY IS DEPRECATED IN FAVOR OF ACTIVE DEVELOPMENT AT mnesiac LIBRARY(Github).

Mnesiam

Mnesiam makes clustering easy for Mnesia database.

The module docs can be found at https://hexdocs.pm/mnesiam.

Installation

The package can be installed by adding mnesiam to your list of dependencies in mix.exs:

def deps do
  [{:mnesiam, "~> 0.1.1"}]
end

Ensure mnesiam is started before your application.

Elixir Version >= 1.4 with libcluster

def application do
  [extra_applications: [:libcluster, :mnesiam]]
end

Elixir Version >= 1.4 without libcluster

def application do
  [extra_applications: [:mnesiam]]
end

Edit your app's config.exs to add list of mnesia stores:

config :mnesiam,
  stores: [Mnesiam.Support.SampleStore, ...],
  table_load_timeout: 600_000 # milliseconds

Usage

Table creation

Create 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:

defmodule Mnesiam.Support.SampleStore do
  @moduledoc """
  Sample store implementation
  """

  alias :mnesia, as: Mnesia

  @table :sample_store

  @doc """
  Mnesiam will call this method to init table
  """
  def init_store do
    Mnesia.create_table(@table,
      [ram_copies: [Node.self()], attributes: [:id, :topic_id, :event]])
    # Sample index
    Mnesia.add_table_index(@table, :topic_id)
    # Add table subscriptions to here
    # ...
  end

  @doc """
  Mnesiam will call this method to copy table
  """
  def copy_store do
    Mnesia.add_table_copy(@table, Node.self(), :ram_copies)
  end
end

Clustering

If 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.

If you are not using libcluster or similar clustering library then:

  • 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.

Enjoy!

Contributing

For any issues, bugs, documentation, enhancements:

  1. Fork the project

  2. Make your improvements and write your tests.

  3. Make a pull request.

License

Apache License 2.0

Copyright (c) 2018 Mustafa Turan

Permission 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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].