Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Makoto Inoue
committed
Nov 15, 2008
1 parent
13e0df9
commit cae703d
Showing
6 changed files
with
53 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,37 @@ | ||
An experimentation to add ORM on top of Tokyo Cabinet http://tokyocabinet.sourceforge.net/index.html | ||
WARNING::: This is not ready, so I haven't created gems yet. | ||
An experimentation to add ORM on top of Tokyo Cabinet | ||
|
||
What Is Tokyo Cabinet? | ||
- Modern implementation of DBM(key/value hash style(HDB), but supports fixed length hash(FDB), and b tree(BDB)) | ||
- High concurrency/ high scalability (developed by a developer at Mixi, Japanese version of Facebook) | ||
- More detail at http://tokyocabinet.sourceforge.net/index.html | ||
|
||
How dm-tokyo-cabinet-adapter stores data into Tokyo Cabinet. | ||
|
||
RESEARCH TOPICS: | ||
- Each object is stored as "ObjName.bdb" file: object id as key and entire data marshalled as value | ||
- Each attribute is stored as "ObjNameAttribute.bdb" file: attribute name as key and reference object id as value | ||
- The above architecture can also be considerd "ObjeName.bdb" as table and "ObjNameAttribute.bdb" as indexes for each attributes. | ||
- Currently implements basic CRUD, association, and eql finder. | ||
|
||
Motivation behind the development. | ||
|
||
- To experiment what you can do with basic hash based database. | ||
Interesting post at http://groups.google.com/group/merb/browse_thread/thread/a8c6b154576c6270 | ||
- To learn internal of DataMapper and how to implement ORM/adapter | ||
|
||
How to install (Work in progress) | ||
|
||
1. Install Tokyo Cabinet http://tokyocabinet.sourceforge.net | ||
2. Install Ruby Binding http://tokyocabinet.sourceforge.net/rubydoc/ | ||
3. Install dm-tokyo-cabinet-adapter | ||
3.1 download dm-tokyo-cabinet-adapter | ||
3.2 cd to the dir | ||
3.3 gem build dm-tokyo-cabinet-adapter.gemspec | ||
3.4 gem install dm-tokyo-cabinet-adapter-0.0.1.gem | ||
4. Set data dir | ||
5. Setup DataMapper.setup | ||
|
||
Further research topics/TODO | ||
- Performance benchmarking. | ||
- At this moment, it's only uses B tree, as it covers the wide range of functionality (range search, duplicate values, transaction support, and so on). Consider replacing part to HDB or FDB for compact storage and speed. | ||
- Are there any ways to retrieve first/last key on FDB/HDB? | ||
- Can TC support "not equal" operation? | ||
- Can TC support "not equal" operation? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Gem::Specification.new do |s| | ||
s.name = %q{dm-tokyo-cabinet-adapter} | ||
s.version = "0.0.1" | ||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | ||
s.authors = ["Makoto Inoue"] | ||
s.date = %q{2008-11-15} | ||
s.description = %q{A DataMapper adapter for Tokyo Cabinet} | ||
s.email = %q{inouemak@googlemail.com} | ||
s.files = ["lib/tc_adapter.rb", "README", "Rakefile", "dm-tokyo-cabinet-adapter.gemspec", "spec/tc_adapter_spec.rb", "spec/spec_helper.rb"] | ||
s.homepage = %q{http://github.com/makoto/dm-tokyo-cabinet-adapter} | ||
s.require_paths = ["lib"] | ||
s.rubygems_version = %q{1.2.0} | ||
s.summary = %q{A DatMapper adapter for Tokyo Cabinet} | ||
s.test_files = ["spec/tc_adapter_spec.rb", "spec/spec_helper.rb"] | ||
end | ||
|
||
|
||
require 'dm-core' | ||
require 'tokyocabinet' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
require 'rubygems' | ||
|
||
require 'pathname' | ||
require Pathname(__FILE__).dirname.parent.expand_path + 'lib/tc_adapter' | ||
|
||
|
File renamed without changes.