NoSQL for mobile apps? [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
开发者_开发知识库 Improve this questionIs there any established noSQL database solution to be used for developing native mobile applications (Android and/or iOs)?
I don't think there's an established NoSQL backend for native mobile apps, but Couchbase Mobile is a great NoSQL database with implementations for both iOS and Android.
iOS: http://www.couchbase.com/products-and-services/mobile-couchbase
Android: https://github.com/couchbase/couchbase-lite-android
leveldb is the new kid on the block. It's a key'/value store much like BigTable, but designed for embedded devices. Their license is New BSD, which is much better than the LGPL in Tokyo Cabinet.
It's blazingly fast and build right out of Xcode.
I wouldn't be surprised if there's a Tokyo Cabinet port for mobile OSs; but seriously, what would NoSQL bring over the SQLite library already included in every platform?
- simple semantics. it's just as easy to do key/value in SQL as it's on any NoSQL database
- scalability. a multipetabyte-capable phone doesn't qualify as a mobile platform.
- trivial sharding. clusters of phones aren't so popular yet
- small implementation. tokyo cabinet source code is 4.8MB, SQLite is 4.7MB. no real gain (and it's already there).
in short, you can just use SQLite as a 'small NoSQL' if you want. it's quite fast too.
Edit:(Apr 2016)
Realm is the way to go nowadays.
If anyone is still interested, I have found this two wrappers for TokyoCabinet:
- TSDocDB
- BNRPersistence
Anyway, I think LevelDB is better.
for android there's this:
https://github.com/rehacktive/waspdb
it's an alpha stage for now, but it could fit your request.
CouchDB is frequently advertised as a NoSQL DB for mobile apps because of its synchronization capabilities. Also there is a beta release of Mobile Couchbase.
SnappyDB seems to quite good NoSQL option for android. The read/write benchmarks against SQLite are pretty amazing.
iBoxDB is a high performance NoSQL database with implementations for both Android and Windows Phone. easy to use, zero configuration, copy and run.
for java android https://github.com/iboxdb/forjava
for.net windows phone https://iboxdb.codeplex.com/
Something new that I wrote in Objective-C is SimpleDB. It is a key/value store and can be found here: http://github.com/AaronBratcher/SimpleDB
Because the values stored must be JSON, sorting can be accomplished and specific parts of the data can be returned.
Special Features
- Very easy to use - NO SQL REQUIRED!
- Auto-Delete option for entries after specified date
- No direct database interaction required to use the class - it does it all
- All methods are class level methods, so no instance of the class required
- Thread safe
API
+(BOOL) hasKey:(NSString*) key inTable:(NSString*) table;
+(NSArray*) keysInTable:(NSString*) table;
+(NSArray*) keysInTable:(NSString*) table orderByJSONValueForKey:(NSString*)jsonOrderKey passingTest:(BOOL (^)(NSString* key, NSString* value, NSDate* dateAdded, NSDate* dateModified));
+(NSString*) valueForKey:(NSString*) key inTable:(NSString*) table;
+(NSDictionary*) dictionaryValueForKey:(NSString*) key inTable:(NSString*) table;
+(id) jsonValueForKey:(NSString*) jsonKey tableKey:(NSString*) key inTable:(NSString*) table;
+(void) setValue:(NSString*) value forKey:(NSString*) key inTable:(NSString*) table;
+(void) setValue:(NSString*) value forKey:(NSString*) key inTable:(NSString*) table autoDeleteAfter:(NSDate*) date;
+(void) deleteForKey:(NSString*) key inTable:(NSString*) table;
+(void) dropTable:(NSString*) table;
+(dbStatus) status;
+(NSString*) guid;
精彩评论