L
L
link002015-07-12 04:20:19
MySQL
link00, 2015-07-12 04:20:19

Which is better, XML or JSON, for SerializedLOB?

Let's say there is a Real Estate Catalog (or a catalog of goods, we have these tools). If the attributes of objects / goods of goods are stored in SerializedLOB (this is a pattern called so by Fowler, i.e. a serialized object), then what do you think is more suitable in this case, XML or JSON? (i.e. part of the data is normalized, and there is the main table "objects" / "products", but the individual attributes are placed in a separate field, in the form of a serialized object). Interested in MySQL.
1. XML. Attractive next.
a) There is XQuery, XPath. No need to reinvent the wheel, just form XPath queries. (However, the thing is rather slow...)
b) In SQL2006, the functionality of working with XML has been extended, it also involves inserting queries to XML directly in the SQL query.
2. JSON
a) More concise
b) MySQL should soon have functions for working with JSON. Serialize to binary format, work fast.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AlikDex, 2015-07-12
@AlikDex

Why is there no option to serialize objects? If you need to store objects, then I would prefer JSON serialization

X
xmoonlight, 2015-07-12
@xmoonlight

json is more versatile and faster to parse.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question