Tokyo Cabinet

Document Sample
Tokyo Cabinet Powered By Docstoc
					Tokyo Cabinet

simple and fast DBM
                        features
• an implementation of UNIX DBM
   – c.f. Berkeley DB, GDBM, CDB, and QDBM
   – stores and retrieves “key/value” pairs
   – hash table on file
• very fast storage and retrieval
   – store: 13.5 sec / 10M records
   – retrieve: 23.6 sec / 10M records
• small file size
   – overhead: 4 bytes per bucket + 16~20 bytes per record
   – e.g. 467,776,380 / 10M records (each 16 bytes)
• no actual size limitation
   – max size: 8EB on 64-bit system, 8TB on 32-bit system
              implementation
• conforming to C99 and POSIX
  – runs on Linux, Solaris, BSDs, and Mac OS X
  – Windows (MinGW) support (in the future)
• thread safe and high parallelism
  – uses Pthreads
  – locking by record
• record compression
  – supports Deflate and Block Sorting
• OO-style APIs
  – bool put(DB *db, char *key, char *value);
  – char *get(DB *db, char *key);
                      file format
• four sections in one file
  – meta data
  – bucket array
  – free block pool
  – record entities
• hash table and binary search tree
  – handles collision of hash value by tree
  – compares by the second hash function
  – typically O(1) and worst O(log n)
                    meta data




                  bucket array




                free block pool




                record entities

…   …   …   …

…   …   …

…       …   …

…   …   …   …
bucket array




                                     binary search tree


            …      L   R     …       150




    …   L      R   …         170                          …   L   R   …       130



                   …         L   R   …     160
                                                                  …   L   R     …   120
…   L   R      …       180
               future missions
• transaction and its log file
  – improves reliability
• B+ tree API
  – supports range search and cursor
• bindings for scripting languages
  – Perl, Ruby, and Java
• applications
  – memcached-like server mechanism
  – inverted index

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:1
posted:12/5/2011
language:English
pages:7