guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ANN] guile-wiredtiger 0.2


From: Amirouche Boubekki
Subject: [ANN] guile-wiredtiger 0.2
Date: Fri, 06 Nov 2015 09:06:39 +0100
User-agent: Roundcube Webmail/1.1.2

Héllo Guilers!


I'm happy to announce the immediate availability of guile bindings of wiredtiger [0][1] aka. guile-wiredtiger 0.2.

It licensed under GPLv2 or GPLv3.

# Kesako wiredtiger?

At the very core, it's a configurable persistent ordered key/value store, column aware, with global transactions.

wiredtiger is a versatile database built by the engineers who created Oracle Berkeley Database (formely known as Sleepycat Database and bsddb) to be the best of its kind taking advantage of new hardwares.

It's today the database engine of mongodb.

# Installation

wiredtiger does not work on 32 bits architectures.

It was tested with wiredtiger 2.6.2 currently develop branch.

You need to install wiredtiger with the usual cli dance:

  git clone https://github.com/wiredtiger/wiredtiger.git
  cd wiredtiger
  git checkout develop
  ./configure && make && make install

And then clone guile-wiredtiger:

  git clone address@hidden:a-guile-mind/guile-wiredtiger.git

There is two modules `wiredtiger.scm` and `wiredtigerz.scm` each of which has a documentation file.

The second module `wiredtigerz.scm` provide an extra set of procedures to make it easier to work with wiredtiger and simplify common access to the database. An example tuple space database can be found in `uav.scm` [2], other examples can be found in the example directory. Even if they don't work they can give an idea how things can be done...

# Getting started

One of the advantage of wiredtigerz.scm is that it's compatible with raw bindings. You can declare a UAV table, create it unconditionally and open cursor over it using the following code:

  ;; define table configuration
  (define-public *tuples*
    '(tuples
      ((uid . string) (attribute . string))  ;; key columns
      ((value . string))  ;; value columns
      ()))  ;; empty indices

  ;; open thread safe database connection
  (define connection (connection-open "/tmp/" "create"))

  ;; open session (not thread safe)
  (define session (session-open connection))

  ;; create table (wiredtigerz specific)
  (session-create* session *tuples*)
  (session-close session)  ;; not needed anymore

  ;; create context (wiredtigerz specific)
  (define context (context-open connection *tuples*))

  ;; retrieve cursor (wiredtigerz specific)
  (define cursor (context-ref context 'tuples))

  ;; use cursor with wiredtiger procedures...

Context is thread specific and only opens one kind of cursors for a given table specification so it entails a particular way of working with the database. In particular it assumes that you don't use the cursor to retrieve results lazily... The good news is that you can create the database using the declarative configuration and rely on plain wiredtiger procedure to do advanced stuff.

Also the above declarative configuration doesn't specify indices with projections. If you do declare indices cursors will be opened for them. Refer to wiredtigerz.md for more information.


# Changelog

## 0.2

- add handy procedures in wiredtigerz.scm
- rely on wiredtiger packing infrastructure

## 0.1

- initial release

# Roadmap

- add server helpers


[0] http://www.wiredtiger.com/
[1] http://source.wiredtiger.com/2.6.1/index.html
[2] https://git.framasoft.org/a-guile-mind/guile-wiredtiger/blob/master/uav.scm

--
Amirouche ~ amz3 ~ http://www.hypermove.fr



reply via email to

[Prev in Thread] Current Thread [Next in Thread]