Skip to content

Instantly share code, notes, and snippets.

@makoto
Created April 11, 2012 13:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makoto/2359195 to your computer and use it in GitHub Desktop.
Save makoto/2359195 to your computer and use it in GitHub Desktop.
こんにちは、某所で豆腐ハンバーグを食べないといけないくらい貧乏ということになっているタムタムです。(なんか面白かったのでこのネタしばらく使います)
Hi, I am TamTam. (and some Japanese jokes).
今回は AvocadoDB というものを紹介したいと思います。
間違いや勘違いがあったらご指摘くださいませ。
Today, I want to introduce AvocadoDB. Let me know if you find anything I misunderstood.
一言でいうと、MongoDB と OrientDB を足したようなものです。Webサイトに掲載されている特徴を列挙すると以下のようになります。
In one word, AvocadoDB looks like the combination of MongoDB and OrientDB. Here are the features list on their web site.
スキーマレスです
クライアント・サーバモデル(アプリケーションサーバとして動作)です。そしてRESTインターフェースを提供しています。
JavaScriptエンジン(V8)を内蔵していて、それでデータを操作できます(もっと言えば、自分でJS追加すると機能を拡張できる!! のでKTのLuaバインディングっぽい事がもっと簡単にできます)
マルチスレッドで動作します
MVCCモデルです。ドキュメントは(内部的には追加オンリー)でバージョン管理していて、古いバージョンは自動でガベコレされます。(PostgreSQLみたいなやつ)
柔軟なデータ構造を提供します。単純なKVS、DocumentDB、グラフDB(これはまだRESTで扱えないけど、シェルからはJSを介して使えます)
インデックスを選択できます。スキップリストやn-gramインデックスとか。(将来的にはHashIndexやGeoIndexも?)
永続性の設定ができます。
モダンなストレージに対応しています。(※意味が良くわからない・・SSDとかに最適化してるってこと?誰か教えてエロい人)
オープンソースです(Apache Licence 2.0)
- Schema-free schemata let you combine the space efficiency of MySQL with the performance power of NoSQL
- Use AvocadoDB as an application server and fuse your application and database together for maximal throughput
- JavaScript for all: no language zoo, use just one language from your browser to your back-end (NOTE: a bit like Kyoto Cabinet's Lua binding).
- AvocadoDB is multi-threaded – exploit the power of all your cores
- Flexible data modeling: model your data as combination of key-value pairs, documents or graphs – perfect for social relations (NOTE: You can not use GraphDB via REST interface, but you can access via JS).
- Free index choice: use the correct index for your problem, be it a skip list or a n-gram search (NOTE: Maybe HashIndex and GeoIndex will be implemented in future?)
- Configurable durability: let the application decide if it needs more durability or more performance
- No-nonsense storage: AvocadoDB uses of all the power of modern storage hardware (NOTE: What does this mean? Optimised for SSD? Need more explanation), like SSD and large caches
- It is open source (Apache Licence 2.0)
(追記)
※MVCCについて、Frank Celler(@fceller) さんからコメントがあったので記載しておきます。
(NOTE)
* Response from Frank Celler(@fceller)
@fceller said:
currently we have implemented Multi-Versions (aka Revisions) of documents. CC will come, when we have replication.
ちょっと英語とMVCCについての理解が浅いので勉強してくる(( T_T)
(追記ここまで)
(NOTE: I don't know much about MVCC, so I need to study more)
(NOTE END HERE)
AvocadoDB の何が熱いかと言うと、開発者のレスポンスの早さと開発速度がちょっとクレイジーなくらいはやいところ。今だとAvocadoDBについてTweetすれば関係者がレスポンスくれます。日本語でもだいたい反応してくれます。(というか、TwitterをAvocadoDBで検索すると、開発者か日本人しかつぶやいていません・・)
あと、絶賛開発中なのにドキュメントが綺麗・豊富に揃っています。なので、Wiki を見ればだいたいの事は載っています。(目次からたどれないページがいくつかあるように感じるので、ページ一覧から行く方が早いです)
常識的なC++で書かれているので(一部Cのコードもあります)ソースコードは読みやすいです。コメントもきちんと書いてあります。RESTに関してはコアな機能がC++で実装されていて、ほとんどがJSで実装されておりコアな機能を呼び出しているという形式になっています。
What's great about AvocadoDB is the development speed of the project and super quick response from the author. If you tweet something about AvocadoDB even in Japanese, the author responds back (To be honest, majority of tweets about AvocadoDB are either done by the author or Japanse).
Also, there are plenty of documents, so you can find most of stuff at their wiki page (There are few broken links in their index, so better to browse from their page lists).
The code is written in standard C++(Some are written in C), so easy to read their source code. There are also enough comments on source code. In terms of their REST implementatgion, the only core part is written in C++ and the rest are implemented in JS and these JS are calling these core functionality .
開発者がどれくらい熱いかと言うと、アレな会社で一般人なイケメンをやっている人のTweetに対してVideoで返信してくるとか。
Here is one example which shows how passionate the author is. When someone tweets, then the author replies back with video!!
http://www.avocadodb.org/2012/04/03/skip-list-indices-in-avocadodb
各言語のDriverというかClientというかバインディングみたいなものは、公式ではPHPのものがあります。他の言語については、皆様が絶賛開発中です(なぜかみんな日本人)。現在の対応状況がロードマップに記載されています。
なお、JavaのDriverは私が絶賛開発中でございます。
In terms of language binding, there is php binding provided officially, and other third party people are developing for other language bindings (for some reason, they are all Japanese). The current state is in their roadmap page.
BTW, I am in the middle of craeting Java Driver.
進捗としては、DocumentDBとして使えるところまでは出来ています。今ユニットテストをいっぱい書いてます・・。じゃないとサーバの挙動が変わった時にregression testが出来なくて死ぬので。
概要だけ書いておくと、AvocadoClient, AvocadoDriver, AvocadoJDBCDriverという構成になります。AvocadoClientはオブジェクト指向的に扱うためのインターフェースでDocumentクラスがcreateとかを持つようになります。AvocadoDriverはREST-APIとほぼ1:1に対応した低レイヤーのインターフェースになります。AvocadoJDBCDriverはJDBCドライバとして実装しているものになります。今作っているのはAvocadoDriverです。Client/Driverと分けたのは、CommonsHttpClient4やsvnkitのような感じの低レイヤーのものと高レイヤーのものとで分離したかったからです。
With my driver, you can use AvocadoDB as a documentDB. I am currently working on writing lots of unit tests, otherwise I will be in trouble when server specification changes.
The driver consists of 3 layers, AvocadoClient, AvocadoDriver, AvocadoJDBCDriver. AvocadoClient is an interface to use AvocadoDB in OO like where Document class has a constructor. AvocadoDriver maps one to one with their REST-API. AvocadoJDBCDriver is implemented as JDBC driver. I am currently working on AvocadoDriver. I seperated Client and Driver into different layers, because I wanted to seperate low level layer and higher level layer like CommonsHttpClient4 abd svnkit do.
こんな感じで使いますというのをGistに簡単なサンプルを載せました。(検証コードがあちこちにあって見づらいですが、使い方は至ってシンプルだと思います。)
まだgithubにはpushしてません。もうしばらくお待ちくださいませ。
Here is the Gist with simple example (It may be a bit difficult to read because it clutters with some verification code, but I think usage is quite simple).
I haven't pushed this to github, so bear with me for a moment.
AvocadoDBのインストールの方法や簡単な使い方、グロッサリーの説明は別の記事に書きます。
I will write about installation , basic usage, and explanation of glossary in seperate article.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment