5 ms·
It’s used that way in a lot of mobile applications. A really solid JSON store with easy query ability.
by chews 6y ago
It’s used that way in a lot of mobile applications. A really solid JSON store with easy query ability.
- liuliu 6y agoShameless plug: Dflat wraps SQLite in similar ways for mobile applications: https://dflat.io/ https://dflat.io/
- tksb 6y agoThanks for posting this! Very interested in Realm-like solutions.
- liuliu 6y agoThanks! Realm is really easy to start, but not far from Core Data in its API. Dflat focuses on writing correct code easy, thus, its API is fairly different from these two. Its API resembles from Apple's PhotosKit (which I liked the interface a lot), but generalized it and makes sure you can have concurrent and synchronous read, managed write threads, strict-serializable multi-reader / multi-writer. Also paid extra attention to edge cases such as schema upgrade upon disk full (hence, read-only schema upgrade).
- tksb 6y agoSounds awesome. I've saved it and hope to find some time to dig in a little bit soon. Thanks for the additional details!
- kevinday 6y agoJust a suggestion: "If you are familiar with Core Data or Realm, Dflat occupies the same space as these two". I'm not familiar with either of these, even a brief description of what this is would be super helpful.
- liuliu 6y agoDone! Thanks for the head-up.
- triangleman 6y agoYes it seems the json() function is good enough for most applications, and in fact you probably want to use it anyway as it will minify the JSON input before inserting. Now, a dedicated JSONB datatype (and indexes!) like Postgres would be awesome, but sqlite3's "poor man's JSON" seems appropriate for many use cases.
- formerly_proven 6y agoUnfortunately can't be "universally relied on", as it remains disabled by default and in many distributions (mostly Linux, but e.g. Python for Windows has an SQLite with few extensions, which you can fix quite easily though by replacing the sqlite3.dll).
- samatman 6y agoSQLite has the rare combination of being superbly stable and backwards compatible (thus, little motive for systems to keep it up to date) and regularly shipping new features I want. As a result, I like to statically link it into the binary, when possible. Life is too short to write a bunch of feature discovery and graceful degradation code.