티스토리 뷰

SW

XML과 JSON - pros and cons

삼방박사 2019. 7. 31. 18:04

Pros

Both are human readable, although I question the value of that for complex payloads.

Both are probably highly compressible, although that is yet another CPU intensive operation.

Both sell more CPUs and hence more software licenses.

Cons

Both are extremely verbose, taking up to an order of magnitude or more payload size to convey the same information as a binary format.

Both require parsing of some sorts instead of decoding.

The difference being that parsing requires string matching that is compute intensive, where are decoding is usually just a lookup function.

Differences

XML Schema can describe virtually every type known to man.

JSON is normally used with informal contracts and often relies on loose typing.

Use XML when strong typing is needed, use JSON when performance is needed.

Use XML when you don't control both sides of a conversation and use JSON when you do.

A corollary, use SOAP when you don't control both sides of the conversation as with external services accessed by consumers and partners but not with your code, and use REST when you have control like on web pages.

JSON was created because XML was too verbose, to heavily typed etc.

'SW' 카테고리의 다른 글

Selected data visualization tools  (0) 2019.07.31
Selected Linux desktop  (0) 2019.07.31
Analytic database  (0) 2019.07.31
Machine Learning related  (0) 2019.07.31
Project management related  (0) 2019.07.31
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크