I'm pondering 2 approaches
- Caching the JSON responses as JSON files
- Caching the Java POJOs (the JSON responses are already de-serialised using Retrofit) using Reservoir.
Description of the data:
The data I want to cache here are a list of 20 products from an e-commerce site. They are not complicated objects and there is no nesting since jsonapi.org specs are used here.
With Retrofit I can already get 20 Product POJOs where Product is the Java model class with less than 10 attributes.
Which approach is better and why?
I'm not considering SQLite databases since I think it is more expensive and only suitable when
- data integrity is required
- there are write operations e.g. shopping cart
- larger amount of data with complicated relationships