irmin

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

Subscribe to updates I use irmin


Statistics on irmin

Number of watchers on Github 846
Number of open issues 46
Average time to close an issue 11 days
Main language OCaml
Average time to merge a PR 2 days
Open pull requests 10+
Closed pull requests 8+
Last commit about 2 months ago
Repo Created about 5 years ago
Repo Last Updated about 1 month ago
Size 8.3 MB
Organization / Authormirage
Latest Release1.3.3
Contributors16
Page Updated
Do you use irmin? Leave a review!
View open issues (46)
View irmin activity
View on github
Latest Open Source Launches
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating irmin for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Irmin -- A distributed database that follows the same design principles as Git

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 to run everywhere, from Linux, to browsers and 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 keep track of reads as well as writes) and to define event-driven workflows using a notification mechanism.

These abstractions allow developers 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 stores raw contents into a well-balanced rope where leafs are chunks 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, a prototype 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.Infix
open Irmin_unix
module Store = Irmin_unix.Git.FS.KV (Irmin.Contents.String)

let config = Irmin_git.config ~bare:true "/tmp/irmin/test"
let info fmt = Irmin_unix.info ~author:"me <me@moi.com>" fmt

let prog =
  Store.Repo.v config >>= Store.master >>= fun t ->
  Store.set t ~info:(info "Updating foo/bar") ["foo"; "bar"] "hi!" >>= fun () ->
  Store.get t ["foo"; "bar"] >>= fun x ->
  Printf.printf "Read: %s\n%!" x;
  Lwt.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-unix) 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

See the LICENSE file.

Acknowledgements

Development of Irmin was supported in part by the EU FP7 User-Centric Networking project, Grant No. 611001.

irmin open issues Ask a question     (View All Issues)
  • over 1 year Issues with pulling/pushing remote repo
  • over 1 year Documentation for `bare` repository unclear.
  • almost 2 years Compiling the examples seem broken
  • about 2 years View.update is really expensive
  • about 2 years Error loading irmin.mirage from utop.
  • about 2 years Dependency problem with sexplib?
  • about 2 years Expose `/remotes/` branches for the Git backend
  • about 2 years Expose some kind of "mtime"
  • about 2 years Problem while trying to sync a remote using Irmin_mirage
  • over 2 years http: error format
  • over 2 years http: internal error, uncaught exception if too many connections
  • over 2 years Setting compression level to 0 in Irmin_git doesn't disable compression.
  • over 2 years Must `BC` require `HRW`?
  • over 2 years Issue with recursive merging of deleted values
  • over 2 years Better IO functions
  • over 2 years Use Jsont
  • over 2 years Use Fmt
  • over 2 years rest api: /view/merge-path returns "ok": null on success
  • over 2 years rest api: /view/create returns "-" separated string in json output
  • over 2 years rest api: /view/create is /view/create/create
  • over 2 years Implement `Irmin.compare_and_set`
  • over 2 years REST API: JSON parse error when numbers are not in quotes
  • over 2 years REST API: remove-rec without parameters deletes everything
  • over 2 years Review `Task.uid`
  • over 2 years Document the binary format of the REST API
  • over 2 years More consistent types for params and results in the REST API
  • over 2 years Review the error path of the REST API
  • over 2 years Type the JSON fields
  • over 2 years Document the `.irminconfig` file
  • over 2 years The `-s` option of the irmin command-line is obscure
irmin open pull requests (View All Pulls)
  • Fix performance problem in lcas
  • First tentative for Ir_funview.
  • Convenience functors to to customize node metadata
  • ptime is used by the mirage backend only, so moving it to depopts
  • Test windows
  • remove unused META files
  • irmin-chunk: Fix content types
  • Use the new ocaml-git in irmin-git
  • Depend on cohttp 1.0.0
  • HTTP REST API
irmin list of languages used
irmin latest release notes

1.3.3 (2018-01-03)

  • complete support for OCaml 4.06 (#484, @samoht)
  • support cohttp 1.0 (#484, @samoht)

1.3.2 (2017-11-22)

  • support OCaml 4.06 where -safe-string is enabled by default (#477, @djs55)

1.3.1 (2017-08-25)

  • irmin-http: update to cohttp.0.99 (#467, @samoht)
Other projects in OCaml