Hello all, we're looking into moving to the KMM fr...
# multiplatform
r
Hello all, we're looking into moving to the KMM framework as a base for our Android and iOS apps and am tasked with investigating what the storage options are that work in the KMM framework for both Android and iOS. It looks like SQLDelight is a popular option, are there any others? Is there a comparison or review available somewhere of these options and pros and cons etc?
j
Yeah, SQLDelight is by far the most popular but a few other options as well https://github.com/AAkira/Kotlin-Multiplatform-Libraries#storage
r
Thank you! Will look these up.
Interesting that the one lib I found browsing is not listed in the above list: https://github.com/line/abc-kmm-shared-storage
r
There is also Realm: https://realm.io/realm-kotlin/
k
What kind of storage are you looking for? Structured DB? Key/value? Files?
Full disclosure, I’m a SQL fan (and mostly manage the native driver for sqldelight)
x
Working on a simple file storage here - but this is little while away from being ready
j
While I haven't yet open-sourced, I've built KMP bindings for Couchbase Lite, which I've found to work well in a couple projects. Couchbase provides flexible-schema JSON document storage, key-value and SQL querying, and built-in offline-first backend synchronization. I plan to release my KMP bindings library soon.
r
@kpgalligan, as of now we are just looking at storing sharedprefs or userpreferences but it could contain more things like documents the user creates at a later point in time.
x
For shared preferences you can use @russhwolf's multiplatform-settings
r
Or @louiscad’s Splitties Preferences: https://splitties.louiscad.com/modules/preferences/
k
@rrg For that kind of storage, one of the shared prefs libraries is a good option. SQL is great, but if you only want key/value, it’s more work than it’s worth (generally speaking). I vote https://github.com/russhwolf/multiplatform-settings but we work together. I haven’t tried the other one 🙂
u
Hi @Jeff Lockhart, I am currently looking for some multiplatform-approachs for our couchbase-integration. Do you already have published something somewhere!? Right now we are just evaluating couchbase itself, but ,as we also think about a complete multiplatform approach with compose-ios, two different sdks feels somewhat wrong 😉 Thanks
j
Hi, @Uli Niggemann. I'm close to being able to publish my Couchbase Lite KMP library. The only real blocker is getting this PR merged upstream, as I'd like to avoid releasing with a fork of Okio. My goal is to publish as soon as that's available in a public Okio release. The library currently works with Couchbase Lite 3.0's full API, both community and enterprise editions. I'll start working on the newly released 3.1 API soon. Android, JVM, iOS, and macOS are fully supported targets, with experimental support for Linux and Windows using the CBL C SDK. The API aligns with the CBL Java/Android SDKs. So it's easy to switch to if you've already got Kotlin code using either of those.
u
Hi Jeff, that sounds amazing. I’ll have a look at your PR tomorrow!