>>32I'd say it depends highly on exactly what you're serializing, and who
you want to read it. If you're storing records of people with names,
birthdays, street addresses, and other good-for-homework collections
of data that mimic slightly mutable hashes themselves, and especially
if there's a possibility that in 10 years another programmer will want
to pull that data into another application, then JSON serializing is
probably not a bad choice. If you're using it to store something
that's already pretty specifically defined, like states of a
chessboard, just suck it up and use Huffman coding of the board state,
especially if you are expecting to run into size constraints.
In general though, I'd be cautious. JSON is, after all, representing
data fundamentally as a nebulous mapping, right? Since you're using
db, you've got a nebulous mapping system right there! And if your data
is tricky enough that you're trying to pass off the serialization
burden to another representation (assuming your application doesn't
pass around JSON blobs internally), it might be something like image
data, in that it can probably be serialized better a different way.