首先申明:这个nosql数据库学习系列纯属是再记录一些看到的,学到的,学术味确实很低。。。
第二个数据库Tokyo Tyrant也是一个键值类型的数据库,但是永久性存储
推荐大家看:Tokyo Tyrant
话说kyototycoon这个数据库也很类似:http://fallabs.com/kyototycoon/
TokyoTyrant数据库相比于memcached,最大的有点就是可以永久存储。
介绍Tokyo Tyrant之前,先介绍下Tokyo Cabinet键值存储数据库,该数据库最大的缺点就是不能联网,这是本地的数据库,但是现在互联网应用对数据库的需要时那么大,Tokyo Tyrant也就应运而生了,他是Cabinet的网络客户端,对其进行封装,增加了一个互联网的接口。所以,这就是为什么我在使用Tokyo Tyrant之前要先安装Tokyo Cabinet数据库了。
他和memcached存储地方不同:一个是在硬盘,一个是在缓存,同时,Tokyo Tyrant还引入了数据类型的概念
数据类型不同,所以必须选择我们采用哪种数据类型作为存储方式。
安装:
可以参看:http://blog.csdn.net/pwlazy/article/details/5313405
Install the latest version of Tokyo Cabinet beforehand and get the package of Tokyo Tyrant.
When an archive file of Tokyo Tyrant is extracted,change the current working directory to the generated directory and perform installation.
Run the configuration script. To enable the Lua extension,add the `--enable-lua' option.
./configure
Build programs.
make
Install programs. This operation must be carried out by the root user.
make install
When a series of work finishes,the following files will be installed.
/usr/local/include/ttutil.h /usr/local/include/tculog.h /usr/local/include/tcrdb.h /usr/local/lib/libtokyotyrant.a /usr/local/lib/libtokyotyrant.so.x.y.z /usr/local/lib/libtokyotyrant.so.x /usr/local/lib/libtokyotyrant.so /usr/local/lib/ttskelmock.so /usr/local/lib/ttskeldir.so /usr/local/lib/ttskelproxy.so /usr/local/lib/ttskelnull.so /usr/local/lib/pkgconfig/tokyotyrant.pc /usr/local/bin/ttserver /usr/local/bin/ttultest /usr/local/bin/ttulmgr /usr/local/bin/tcrtest /usr/local/bin/tcrmttest /usr/local/bin/tcrmgr /usr/local/sbin/ttservctl /usr/local/share/tokyotyrant/... /usr/local/man/man1/... /usr/local/man/man3/...
To test the server,perform the following command. To finish it,press Ctrl-C on the terminal.
ttserver
To test the client connecting to the above running server,perform the following command on another terminal.
make check