I have some things that do not need to be indexed or searched (game configurations) so i wa sthinking of storing json on a blob. is this a good idea at all? or are there alternatives?
+2
A:
No different than people storing XML snippets in a database (that doesn't have XML support). Don't see any harm in it, if it really doesn't need to be searched at the DB level. And the great thing about JSON is how parseable it is.
T.J. Crowder
2010-10-22 22:10:12
+4
A:
If you need to query based on the values within the JSON, it would be better to store the values separately.
If you are just loading a set of configurations like you say you are doing, storing the JSON directly in the database works great and is a very easy solution.
Alan Geleynse
2010-10-22 22:10:49
Ya, I do not need the values at all, except for at retrieval. thx
Timmy
2010-10-22 22:13:57
and i do have columns for things that needs to be indexed
Timmy
2010-10-22 22:14:57
That is fine if you are indexing other columns. As long as the data in the JSON does not need to be indexed you can keep it there. You can always change the database later if you ever want to see how many users have some option set, but I am sure you have more interesting things to work on first.
Alan Geleynse
2010-10-22 22:16:31
+2
A:
I don't see why not. As a related real-world example, WordPress stores serialized PHP arrays as a single value in many instances.
stevelove
2010-10-22 22:14:34
A:
I think,It's beter serialize your XML.If you are using python language ,cPickle is good choice.
mahdieh Saeed
2010-10-24 11:58:30
Why? There may be valid reasons, but just saying 'use XXX instead' is not very useful...
StaxMan
2010-10-25 18:50:23