androidkey-value-storeberkeley-db-je

what is the best mechanism for a persistent key-value store on android (with large values)


I want to use a fast key-value store on an Android device where the values are image bitmaps. The store should be backed up by disk and provide some caching, minimizing disk IO. Multi-threaded access is desirable, but not required.

I've looked at Java Berkeley DB which appears to meet the requirements. Are there other libraries that perform better? Or does Berkeley DB perform well on the Android platform?

I'm OK with a solution that requires a single key-value pair to reside in memory, but storing the full key-value pair set, might exceed the size of the device's memory.


Solution

  • I would suggest File based memory caching, works well without overloading device memory. No need for any extra stuff, esp DB won't be optimal way for such needs.

    here are few libs;
    - https://github.com/commonsguy/cwac-cache (deprecated)
    - https://github.com/wareninja/generic-store-for-android
    p.s. key-value store and handles memory-file based optimized caching

    I've been using both of them especially for Image caching, both performing very well so far.