JSON vs. XML vs. Blob

I would like to store some objects in the database in order to be able to restore them  for future use.
I am using Postgres 8.4 and I know that I can serialize those objects ans store them as BLOBs, but , I would like to have a readable format so I can easily debug it and see the stored object content.
1) Is there any option to store a Java object as JSON or XML ?
2) how is it compared to the BLOB  option from performance point of view ?

LVL 19
Who is Participating?
Well XMl as JSSON are simple tex formats. So  you can write them anywhere and reconstruct whatever you likke from it. JSON. What you prefer is you choice. I'd prfer JSON anytime. XML is just too bloated for my taste. See e.g http://json.org/xml.html

And you wrote about storing objects we. than JSON seems to be better because it supposed to be used for that kind of work.

However Postgresql has extra support for XML. See  e.g http://www.postgresql.org/docs/current/static/datatype-xml.html
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.