twitter / flockdb-client
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Tue Apr 13 12:19:12 -0700 2010 | |
| |
LICENSE | Mon Apr 19 10:00:44 -0700 2010 | |
| |
README.md | Mon Apr 19 10:01:40 -0700 2010 | |
| |
Rakefile | Mon Apr 19 10:00:21 -0700 2010 | |
| |
VERSION | Thu Apr 29 19:14:16 -0700 2010 | |
| |
flockdb.gemspec | Thu Apr 29 19:20:41 -0700 2010 | |
| |
lib/ | Thu Apr 29 18:28:02 -0700 2010 | |
| |
spec/ | Thu Apr 29 19:14:16 -0700 2010 |
FlockDB ruby client
FlockDB is a distributed graph database capable of storing millions of nodes, billions of edges, and handling tens of thousands of operations per second. Interact with it in ruby with this client.
INSTALLATION
gem install flockdb
FlockDB depends on thrift and thrift_client, which will install as part of the gem's dependencies. Note that thrift has a native C extension which it will need to compile.
USAGE
Instantiate a client:
flockdb = Flock.new 'localhost:7915, :graphs => { :follows => 1, :blocks => 2 }
Flock.new is a convenience shortcut for Flock::Client.new. Flock.new expects a list (or a single) servers as the first argument, and an options hash. Flock::Client.new takes the same options as ThriftClient for configuring the raw thrift client, as well as :graphs for mapping ruby symbols to the corresponding graph ids. See thrift_client's documentation for information on the other options it takes.
Edge manipulation:
flockdb.add(1, :follows, 2)
flockdb.remove(1, :blocks, 2)
Perform a query:
flockdb.select(1, :follows, nil).to_a
The client supports a rich query api to build up complex set operations:
flockdb.select(nil, :follows, 1).difference(flockdb.select(1, :follows, nil).intersect(2, :follows, nil)).to_a
CONTRIBUTORS
Nick Kallen
Matt Freels
Rael Dornfest
LICENSE
Copyright (C) 2010 Twitter, Inc.
This work is licensed under the Apache License, Version 2.0. See LICENSE for details.


