I am writing an application that communicates with a web API that responds with JSON. I am currently translating JSON objects into Java objects using gson (which, by the way, is awesome).
Now I want to save some of these objects in a SQLite database. However, they have many properties that will never be used in queries (i.e. I will not be ORDER ing, WHERE ing or anything like that with these properties), so I find it unnecessary to create columns for all of them. I think that:
- There are only columns for the master data that will be used when querying the database
- Is there a single
TEXT or BLOB column (which do you recommend?) That stores the actual JSON, so I can recreate my Java object from it and access all the data.
This would make my life easier and simplify my code (I would not have to write completely different code when working with data from the API compared to data from the database).
However, although I see no flaws, he feels a little suspicious.
What problem would you encounter if I use this technique?
Felix source share