Giter Site home page Giter Site logo

rtvt123 / irmin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mirage/irmin

0.0 2.0 0.0 8.36 MB

Irmin is a distributed database that follows the same design principles as Git

Makefile 0.25% OCaml 99.12% Standard ML 0.11% Shell 0.01% HTML 0.06% JavaScript 0.33% CSS 0.12%

irmin's Introduction

Irmin

Irmin is a library for persistent stores with built-in snapshot, branching and reverting mechanisms. It is designed to use a large variety of backends. Irmin is written in pure OCaml and does not depend on external C stubs; it aims is to run everywhere, from Linux to Xen unikernels.

Build Status docs

Description

Irmin is a library to version-control application data. It has the following features:

  • on-disk format various formats are supported, including the Git format: Irmin on-disk repositories can be inspected and modified using the classic Git command-line tools.

  • wire format various formats are supported, including the Git protocol (only in client mode) or a simple JSON-based REST API (client and server).

  • dynamic behaviour Irmin allows the users to define custom merge functions, to use in-memory transactions (to keeps tracks of reads as well as writes) and to define event-driven workflows using a notification mechanism.

These abstractions allow developpers to create applications with concurrent behaviors which are both efficient and safe.

Bindings to other languages

Backends

Irmin ships with various backends. It provides the following OCamlfind pacakges:

  • irmin.mem is an in-memory backend.
  • irmin.git uses the Git format to persist data on disk.
  • irmin.fs uses bin_prot to persist data on disk.
  • irmin.http uses JSON over HTTP to speak with an Irmin server.

Other external backends are available as external OPAM packages (use opam install <pkg> to install):

  • irmin-chunk store raw contents into a well-balanced rope where leafs are chunk of all the same size.
  • irmin-indexdb is a backend for a web browser's IndexedDB store.

Datastructures

  • merge-queues is an implementation of mergeable queues.
  • merge-ropes is an implementation of mergeable ropes.
  • diff-datatypes is a collection of automatic merge functions based on edit scripts. It is fairly generic but contains specific implementation for mergeable trees, stacks and queues.
  • irmin-datatypes is a collection of mergeable datatypes, including LWW registers, queues and sets.

Use-Cases

Here a list of Irmin users:

  • Cuekeeper a version-controlled TODO list in the browser.
  • imaplet, a version-controlled IMAP server and client.
  • jitsu, a DNS server that automatically starts unikernels on demand. The database is persisted with Irmin.
  • Irmin+Xenstore, the Xenstore deamon rewritten to use Irmin to persist its data.
  • irmin-arp, a distributed ARP cache.
  • dog, a synchronisation tool.
  • irminFS prototype of version-controlled file-system using Fuse.

Further Reading

Getting Started

Install

Irmin is packaged with opam:

opam install irmin-unix # install all the optional depencies

Usage

Irmin comes with a command-line tool called irmin. See irmin --help for further reading. Use either irmin <command> --help or irmin help <command> for more information on a specific command.

To get the full capabilites of Irmin, use the API:

open Lwt
open Irmin_unix
let store = Irmin.basic (module Irmin_git.FS) (module Irmin.Contents.String)
let config = Irmin_git.config ~root:"/tmp/irmin/test" ~bare:true ()
let prog =
  Irmin.create store config task >>= fun t ->
  Irmin.update (t "Updating foo/bar")  ["foo"; "bar"] "hi!" >>= fun () ->
  Irmin.read_exn (t "Reading foo/bar") ["foo"; "bar"] >>= fun x ->
  Printf.printf "Read: %s\n%!" x;
  return_unit
let () = Lwt_main.run prog

To compile the example above, save it to a file called example.ml. Install irmin and git with opam (opam install irmin git) and run

$ ocamlfind ocamlopt example.ml -o example -package irmin.unix,lwt.unix -linkpkg
$ ./example
Read: hi!

The examples directory contains more examples. To build them, run

$ ./configure --enable-examples
$ make

Tutorial

Tutorials are available on the wiki.

Issues

To report any issues please use the bugtracker on Github.

Conditions

Copyright (c) 2013-2015 Thomas Gazagnaire [email protected]

Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

irmin's People

Contributors

avsm avatar chris00 avatar damiendoligez avatar djs55 avatar dsheets avatar hnrgrgr avatar magnuss avatar niksu avatar samoht avatar talex5 avatar vbmithr avatar yallop avatar yomimono avatar ztlpn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.