Git Product home page Git Product logo

nessdb's Introduction

================================================================
nessDB v2.0 with Small-Splittable Tree (one of Bε-tree)
Copyright (C) 2012-2013 BohuTANG________________ 
_____________________________  __ \__  __ )
__  __ \  _ \_  ___/_  ___/_  / / /_  __  |
_  / / /  __/(__  )_(__  )_  /_/ /_  /_/ / 
/_/ /_/\___//____/ /____/ /_____/ /_____/  
================================================================

  nessDB is a fast Key-Value database(embedded), which is written in ANSI C with GPL LICENSE and works in most POSIX systems without external dependencies.

  From Version 2.0, nessDB uses Small-Splittable Tree (SST), it's one of Bε-tree and Cache-oblivious write-optimized structure, for more details, please refer to documentations which in 'spec' folder.
  
  V2.0 FEATURES
  =============
  a. Better performances on Random-Read/Write
  b. Using Small-Splittable Tree as storage engine
  c. Using fractional cascading to speed up search
  d. Cache-oblivious write-optimized structure

  HOW TODO BENCHMARK
  ==================
  $make db-bench
  $./db-bench <write | read > <count> 
	or 
  $./db-bench readone <key>

  If you want delete all indexes/db/logs, you should do:
  $make cleandb

  HOW TO USE AS DB ENGINE
  =======================
  a. OPEN
		struct nessdb *db = db_open(db-path); 

  b. ADD
  		struct slice sk, sv;
		sk.len = 3;
		sk.data = "key";
		sv.len = 5;
		sv.data = "value";
		db_add(db, &sk, &sv);

  c. DELETE
  		struct slice sk;
		sk.len = 3;
		sk.data = "key";
		db_remove(db, &sk);

  d. READ
  		struct slice sk, sv;
		sk.len = 3;
		sk.data = "key";
		int ret = db_get(db, &sk, &sv);
		if (ret == 1) {
			printf("data is %s", sv.data);
			db_free_data(sv.data);
		} else
			print("Not found");

  e. EXISTS 
		struct slice sk;
		sk.len = 3;
		sk.data = "key";
		int ret = db_exists(db, &sk);
		if (ret == 1)
			print("yes, exists");
		else
			print("oops");

  f. SHRINK 
  		db_shrink(db);

  g. CLOSE
  		db_close(db);

  Thanks for your attention!

  				--BohuTANG--

nessdb's People

Contributors

believe3301 avatar bohutang avatar codeslinger avatar feinno-zhangyanfei avatar feinno-zhaoboran avatar ldmiao avatar pitulloz avatar qmx avatar tobydipasqualera avatar tonyw avatar zhpengg avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.