Permalink
Browse files

first version, imported

  • Loading branch information...
0 parents commit 01ff42afad512dad9ac61cfdf24ea8d4e8de97f2 Davies Liu committed Dec 29, 2009
Showing with 6,903 additions and 0 deletions.
  1. +1 −0 AUTHORS
  2. +5 −0 CREDITS
  3. +2 −0 ChangeLog
  4. +56 −0 INSTALL
  5. +140 −0 LICENSE
  6. +8 −0 Makefile.am
  7. +38 −0 README
  8. 0 TODO
  9. +5 −0 autogen.sh
  10. +2,259 −0 beansdb.c
  11. +322 −0 beansdb.h
  12. +140 −0 configure.ac
  13. +3 −0 doc/Makefile.am
  14. +74 −0 doc/beansdb.1
  15. +274 −0 doc/protocol.txt
  16. +22 −0 fnv1a.h
  17. +541 −0 hstore.c
  18. +31 −0 hstore.h
  19. +840 −0 htree.c
  20. +28 −0 htree.h
  21. +237 −0 item.c
  22. +135 −0 python/dbclient.py
  23. +157 −0 python/dbserver.py
  24. +38 −0 python/httpd.py
  25. +220 −0 python/proxy.py
  26. +11 −0 python/setup.py
  27. +36 −0 python/status.py
  28. +209 −0 python/store.pyx
  29. +119 −0 python/sync.py
  30. +245 −0 python/test.py
  31. +22 −0 stats.c
  32. +5 −0 t/test.sh
  33. +43 −0 t/test_htree.c
  34. +21 −0 t/test_store.c
  35. +492 −0 thread.c
  36. +2 −0 tools/Makefile.am
  37. +122 −0 tools/convert.c
@@ -0,0 +1 @@
+Davies Liu <davies.liu@gmail.com>
@@ -0,0 +1,5 @@
+Special thanks go to people who have volunteered their time, effort,
+and ideas to make this software available. (Words quoted from squid)
+
+* The code of beansdb is most based on memcachedb <http://memcachedb.org/>
+and Memcached <http://www.danga.com/memcached/>.
@@ -0,0 +1,2 @@
+2009-12-15 0.3.0
+ * First public release.
@@ -0,0 +1,56 @@
+Dependencies
+============
+Before deploying Memcachedb, make sure that following packages installed:
+
+TokyoCabinet 1.3 or later
+-------------------------
+http://1978th.net/tokyocabinet/
+
+libevent 1.3e or later
+-------------------------
+http://monkey.org/~provos/libevent/
+
+Installation
+============
+$svn co svn checkout http://beansdb.googlecode.com/svn/trunk/ beansdb-trunk
+$cd beansdb-trunk
+or
+$wget
+$tar xvzf memcachedb-X.Y.Z.tar.gz
+$cd memcachedb-X.Y.Z
+
+$./configure
+$make
+$sudo make install
+
+Getting Started
+===============
+
+use "-h" option to get started.
+
+Running Examples:
+
+1. run as a single daemon
+
+ beansdb -p7900 -H /data/beansdb -T 0 -v
+
+2. test it
+
+ $ telnet localhost 7900
+
+ < set hello 0 0 5
+ < world
+ > STORED
+
+ < get hello
+ > VALUE hello 0 0 5
+ > world
+ > END
+
+ < get @
+ > VALUE @ 0 18
+ > hello 933489272 1
+ >
+ > END
+
+Have fun :)
@@ -0,0 +1,140 @@
+Copyright (c) 2009, Douban Inc. <http://www.douban.com/>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+
+ * Neither the name of the Douban Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+This product includes software developed by Mikio Hirabayashi.
+
+[Tokyo Cabinet]
+
+http://1978th.net/tokyocabinet/
+
+This product includes software developed by Steve Chu.
+
+[memcachedb]
+
+Copyright (c) 2008, Steve Chu. <stvchu@gmail.com>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+
+ * Neither the name of the Danga Interactive nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+This product includes software developed by Danga Interactive, Inc.
+
+[ memcached ]
+
+Copyright (c) 2003, Danga Interactive, Inc. <http://www.danga.com/>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+
+ * Neither the name of the Danga Interactive nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+This product includes software developed by Niels Provos.
+
+[ libevent ]
+
+Copyright 2000-2003 Niels Provos <provos@citi.umich.edu>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. All advertising materials mentioning features or use of this software
+ must display the following acknowledgement:
+ This product includes software developed by Niels Provos.
+4. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,8 @@
+bin_PROGRAMS = beansdb
+beansdb_SOURCES = beansdb.c item.c fnv1a.h beansdb.h thread.c htree.h htree.c stats.c hstore.h hstore.c
+
+SUBDIRS = doc tools
+EXTRA_DIST = python CREDITS AUTHORS LICENSE
+
+dist-hook:
+ rm -rf $(distdir)/*/.svn/
@@ -0,0 +1,38 @@
+What is Beansdb?
+*******************
+Beansdb is a distributed key-value storage system designed for large scale
+online system, aiming for high avaliablility and easy management. It took
+the ideas from Amazon's Dynamo, then made some simplify to Keep It Simple
+Stupid (KISS).
+The clients write to N Beansdb node, then read from R of them (solving
+conflict). Data in different nodes is synced through hash tree, in cronjob.
+Beansdb base on memcached and Tokyo Cabinet, with efficient persistant
+hash tree (called Hex Tree) support.
+It conforms to memcache protocol (not completed, see below), so any memcached
+client can interactive with it without any modification.
+Beansdb is heavy used in http://www.douban.com/, stored images, mp3, text
+fields and so on, see benchmark below.
+Any suggestion or feedback is welcome.
+
+Features
+********
+* High availability data storage with multi readable and writable repications
+* Soft state and final consistency, synced with hash tree
+* Easy Scaling out without interrupting online service
+* High performance read/write for a key-value based object
+* Configurable availability/consistency by N,W,R
+* Memcache protocol compatibility
+
+Supported memcache commands
+***************************
+get, gets
+set(with version support)
+delete
+stats
+
+Private commands
+****************
+get @xxx, list the content of hash tree, such as @0
+get ?xxx, get the meta data of key.
+
+For more info, see: http://beansdb.googlecode.com/
No changes.
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+
+echo "autoreconf --install"
+autoreconf --install
Oops, something went wrong.

0 comments on commit 01ff42a

Please sign in to comment.