SnappyDB

A fast and lightweight key/value database library for Android

Introduction

SnappyDB is a key-value database for Android it's an alternative for SQLite if you want to use a NoSQL approach.

It allows you to store and get primitive types, but also a Serializable object or array in a type-safe way.

SnappyDB can outperform SQLite in read/write operations.


SnappyDB is based on leveldb and use snappy compression algorithm, on redundant content you could achieve a good compression ratio

Usage

try {
   DB snappydb = DBFactory.open(context); //create or open an existing databse using the default name

   snappydb.put("name", "Jack Reacher"); 
   snappydb.putInt("age", 42);  
   snappydb.putBoolean("single", true);
   snappydb.put("books", new String[]{"One Shot", "Tripwire", "61 Hours"}); 

   String   name   =  snappydb.get("name");
   int      age    =  snappydb.getInt("age");
   boolean  single =  snappydb.getBoolean("single");
   String[] books  =  snappydb.getArray("books", String.class);// get array of string

   snappydb.close();

   } catch (SnappydbException e) {
 }
            

For more recipes please take a look at the Cookbook.

Get it on Google Play Check out also the Demo App on The Play Store

With SnappyDB you could seamlessly store and retrieve your object/array, it uses Kryo serialization which it faster than regular Java serialization.

Download

↓ SnappyDB

SnappyDB uses native code for performance, it's available for the three main architecture of Android: ARM, x86 and mips.

It is distributed as an Android Library Project

Gradle

    dependencies {
          compile 'com.snappydb:snappydb-lib:0.4.0'
          compile 'com.esotericsoftware.kryo:kryo:2.24.0'
    }
			

License

SnappyDB is opensource, contribution and feedback are welcomed

Copyright 2013 Nabil HACHICHA.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

© Nabil HACHICHA

Google+