首页 > Web开发 > 详细

protocol buffers vs json vs XML

时间:2015-06-10 18:39:04      阅读:240      评论:0      收藏:0      [点我收藏+]
原创文章转载请注明出处:@协思, http://zeeman.cnblogs.com
 
在分布式系统中,数据序列化传递的情形非常常见,主流的三种,JSON、XML、Protobuf。
 
XML现在已经很少使用,除非要和遗留系统交互。
 
JSON用在前端交互和跨组织的API的交互场合比较多。
 
对于内部系统,特别是性能敏感的区域,推荐使用Protobuf,可以得到最快的序列化速度和最小的结果。
 
参考资料:
http://stackoverflow.com/questions/14028293/google-protocol-buffers-vs-json-vs-xml
 
Json
human readable/editable
can be parsed without knowing schema in advance
excellent browser support
less verbose than XML
 
XML
human readable/editable
can be parsed without knowing schema in advance
standard for SOAP etc
good tooling support (xsd, xslt, sax, dom, etc)
pretty verbose
 
Protobuf
very dense data (small output)
hard to robustly decode without knowing the schema (data format is internally ambiguous, and needs schema to clarify)
very fast processing
not intended for human eyes (dense binary)
All have good support on most platforms.

protocol buffers vs json vs XML

原文:http://www.cnblogs.com/zeeman/p/4566912.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!