[ANN] tdb - Trivial Database bindings for Ruby

E

Eric Wong

Hi all, this is a preview release. Much of the API is incomplete
and undocumented, but I figure it could be useful to people already
as it's stable and quite fast.

As usual, git patches and pull requests to the mailing list
(or directly to me) are greatly appreciated.

* http://bogomips.org/ruby-tdb/
* (e-mail address removed)
* git://git.bogomips.org/ruby-tdb.git

From the README:

TDB is much like other DBM implementations, except it allows concurrent
writer processes. TDB was initially developed for Samba, but is used by
other projects as well. These Ruby bindings allow Ruby apps to read and
write to the same databases used by Samba!

== Features

* Concurrent reader and writer processes may safely operate on the
same file. This is great for MRI 1.8 and 1.9 where multi-core
performance is easiest to achieve processes and not threads.

* Fork-safe, you may fork and share the same TDB object in your parent
and child processes.

* Releases the GVL for slow disk operations under Ruby 1.9 so
other threads can run (but not other TDB operations on the same file)

* Includes several {hash functions}[link:Hash_Functions.html]
not included by upstream TDB.

== Caveats

These caveats will be addressed upstream in
{TDB2}[http://mid.gmane.org/[email protected]]

* NOT native thread-safe, you MUST protect your TDB object with a Mutex
if you run it with threads under Ruby 1.9 (but not 1.8).

* Database size is limited to 4G, even on 64-bit systems.

* TDB should be created with an appropriate :hash_size for large databases
or performance will suffer.

== Install

The original tdb library from the {main site}[http://tdb.samba.org/] is
required. Debian users can just <code>apt-get install tdb-dev</code>.

The library consists of a C extension so you'll need a C compiler
and Ruby development libraries/headers.

You may download the tarball from our
{download site}[http://bogomips.org/ruby-tdb/files/] and run setup.rb after
unpacking it:

http://bogomips.org/ruby-tdb/files/

You may also install it via RubyGems on RubyGems.org:

gem install tdb

If you have a tdb installation in a non-standard prefix, you
will have to use:

gem install tdb -- --with-tdb-dir=$PFX

Or if you have a non-standard prefix that linkers normally do not search:

gem install tdb -- --with-tdb-dir=$PFX --with-dldflags=-Wl,-rpath=$PFX/lib

You can get the latest source via git from the following locations
(these versions may not be stable):
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top