Giter Club home page Giter Club logo

ech's Introduction

=======================
ech - Embedded CouchDB
=======================

What and Why
============

ech is an Erlang library that provides a simple interface for using CouchDB
as an embeddable database within your Erlang application.

It is fundamentally different from Erlang clients that interface with
CouchDB over HTTP.

Here's how you'd use it:

  1> {ok, Db} = ech:open("test").
  2> Doc = ech_doc:new("chi", [{name, "Chicago"}, {type, "city"}]).
  3> ech:put(Db, Doc).
  4> {ok, Loaded} = ech:get(Db, "chi").
  5> ech_doc:get_attrs(Loaded).
  [{type,"city"},{name,"Chicago"}]

You might want to work with an embedded database instead of a CouchDB over
HTTP for these reasons:

- You want a simple, scalable, performant data store that is part of your
  application and doesn't have to be installed and managed separately

- You want to build your own distributed database and want to leverage
  CouchDB's outstanding b-tree indexing, lazy indexing, and replication
  support

- The idea of unnecessarily forcing Erlang through a JSON/HTTP layer offends
  your sense of economy

Getting Started
===============

Get the source for CouchDB and note its root directory, which is used as
COUCH_HOME below.

Get the ech source from github.

At a console prompt:

 $ cd ech
 $ export COUCH_HOME=<dir>
 $ make

Running Tests
=============

 $ make TESTS=ech_tests test

Using ech
=========

Refer to ECH_HOME/lib/ech/src/ech_tests.erl for examples.

You can experiment with ech from an Erlang shell by running:

 $ make shell

Installing ech
==============

We're working on this. Until something better is available, you can simply
include ETCH_HOME in the ERL_LIBS environment variable when running your
application. E.g.

 $ ERL_LIBS=<ech home dir> erl

ech's People

Watchers

James Cloos 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.