android - Caching downloaded JSON data to SQLite database - is it a good idea? -


In my app I have to download the Jasonon data from many web services. The data classes I use are quite complex ( Lots of properties, deep legacy trees, etc.).

I intend to do caching using a single DB table, where I will store the downloaded JSON data in a VARCHAR column (with other meta-data columns). JSON is being done with the serialization GSN Library.

It is quite convenient to just dump the instances in JSON, and when I need them, then parses them later. There is no need to create custom tables for every category, or write down loads of custom serialization codes. Besides, I can ask questions like this on the cash table.

Question: Is this approach any kind of anti-pattern?

This approach is not completely wrong; However, I'm going to recommend that you use caching storage instead. See the section "Save cache files" for more details. In this way, you can not leave any valuable location if your JSON objects are large when your storage conditions are low

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -