CSV替代? [英] Alternative to CSV?
问题描述
我打算构建一个RESTful服务,它将返回一个自定义文本格式。鉴于我的大量数据,XML / JSON太冗长。我正在寻找一个基于行的文本格式。
CSV是一个明显的候选人。我不知道如果没有更好的东西在那里。我通过一些研究发现的只有 CTX 和< a href =http://www.fieldedtext.org/ =nofollow>字段文本。
我在寻找一种格式其中提供以下内容:
- 纯文字,易于阅读
- 非常容易解析软件平台
- 列定义可以更改,而不需要对软件客户端进行更改
很好,我可以自己构建一个规范,但我很好奇知道别人做了什么,因为这必须是一个很老的问题。令人惊讶的是,没有更好的标准。
你有什么建议?
我会说,由于CSV是标准,因为每个人都可以解析它, p>
如果我在你的情况下,我会采取带宽命中和使用GZIP + XML,只是因为它很容易使用。
并且,在这方面,你可以总是要求你的用户支持GZIP,只是作为XML / JSON发送它,因为这应该是一个很好的去除冗余的电线。
I intend to build a RESTful service which will return a custom text format. Given my very large volumes of data, XML/JSON is too verbose. I'm looking for a row based text format.
CSV is an obvious candidate. I'm however wondering if there isn't something better out there. The only I've found through a bit of research is CTX and Fielded Text.
I'm looking for a format which offers the following:
- Plain text, easy to read
- very easy to parse by most software platforms
- column definition can change without requiring changes in software clients
Fielded text is looking pretty good and I could definitely build a specification myself, but I'm curious to know what others have done given that this must be a very old problem. It's surprising that there isn't a better standard out there.
What suggestions do you have?
I would say that since CSV is the standard, and since everyone under the sun can parse it, use it.
If I were in your situation, I would take the bandwidth hit and use GZIP+XML, just because it's so darn easy to use.
And, on that note, you could always require that your users support GZIP and just send it as XML/JSON, since that should do a pretty good job of removing the redundancy accross the wire.
这篇关于CSV替代?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!