What approach should I use to minimize disk i/o when reading/writing to SQLite database in Android? Something like ConcurrentHashMap with WeakReferences? Caffeine? GuavaCache?
Should I use built-in caches in ORMs like GreenDao, DBFlow, ORMLite? The documentation is very vague when it comes to clearing these caches... When should I clear them? Should I?
I tried to enable cache in ORMLite, but there were bugs: nulls instead of empty foreign collections after cascade delete/insert of entities...
So what's the best practice? Maybe not to use cache at all and just to read/write from DB asynchronously to ensure fresh data?