6 ms·
I know that it's the go-to solution for small, simple storage, but why on earth do mobile platforms have schema-driven data stores by default? There are a few
by briancooley 16y ago
I know that it's the go-to solution for small, simple storage, but why on earth do mobile platforms have schema-driven data stores by default?
There are a few other easy ways to store data[1] on Android. For example, you could use SharedPreferences for lightweight data. You could write anything that implements the Serializable interface to a file on internal or external storage. I don't know much about Redis, but if all you want to do is persist a key-value store, create a HashMap in your app and write to and read from disk.
You can do something similar with an NSDictionary or NSArray in iOS. [2]
[1] http://developer.android.com/guide/topics/data/data-storage.html http://developer.android.com/guide/topics/data/data-storage....
[2] http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/Reference/Reference.html http://developer.apple.com/library/mac/#documentation/Cocoa/... (see initWithContentsOfFile: and writeToFile:atomically:)
- mbleigh 16y agoI am aware of SharedPreferences, and serialization is certainly an option, but ultimately these don't solve the main problem I've experienced. Serialization requires a lot of manual work and it may not scale particularly well for middle-weight and up. I just think that the kinds of data stored in mobile applications lend themselves more to some of the various NoSQL patterns than something like SQLite.
- asher 16y agoCan't you treat SQLite as a key-value store? Create a table with two columns: key and value. Blobs can be pretty big. Seems to me that a relational DB can easily impersonate a hash, but not vice versa.