将数据从客户端传输到服务器的最佳格式/压缩/协议?
我们有多个客户端向服务器请求工作 - 10000 个 url 的列表。= 1MB
并将处理后的数据发送回服务器 - 每个 URL 大约 1KB,即 10 MB
每个客户端每 5-10 分钟就会执行一次。
我依次要求可扩展性、高性能和平台独立性。
我应该使用 XML 还是自定义二进制格式进行传输?
最好使用的压缩类型? gzip,我看到 .NET 人们使用 ICSHARP 库。权衡是什么?
客户端应该通过 POST 发送数据吗?或者任何其他更好的方法?
对于这种情况还有其他需要记住的建议吗?
We have multiple clients asking for work from server - a list of 10000 urls .= 1MB
and sending back processed data back to server - around 1KB per URL i.e. 10 MB
Each client will do that every 5-10 minutes.
I have requirements of extensibility, high performance and platform independence in that order.
Should i use XML or custom binary format for transfer ?
Best compression type to use ? gzip, i see .NET folks using ICSHARP library. What are trade-offs ?
Should client send data via POST ? or any other better method ?
Any other suggestions to keep in mind for such scenario ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会关注 BSON,只是因为它现在受到了很多关注,并且您应该会发现序列化器得到了很好的支持。它也是一个相当严格的有线协议,这就是为什么它是一些备受瞩目的 nosql dbms 的焦点。
就压缩而言,请使用您的网络服务器支持的任何内容(可能是 gzip)。压缩的权衡几乎总是归结为消耗的 CPU 周期与压缩的紧凑性。但最终,gzip 是一个很好的中间道路,使用它所需要做的就是打开它。
是的,POST 是适当的方法。
如果性能或并发性成为瓶颈,您可以将 gzip(以及 SSL、身份验证和会话以及许多其他内容)移至 Web 服务器前面的一层。但我的直觉是,您将在服务器端受到 I/O 限制。祝你好运。
I would look at BSON, only because it's getting a lot of attention now, and you should find the serializers well supported. It's also a fairly tight wire protocol, which is why its the focus of a few high-profile nosql dbms's.
As far as compression, use whatever your web servers support (probably gzip). The tradeoffs with compression almost always comes down to cpu cycles consumed vs compactness of the compression. But in the end, gzip is a good middle of the road, and all you have to do to use it is turn it on.
Yes, POST is the appropriate method.
If performance or concurrency become bottlenecks, you can move gzip ( and SSL and authentication and session, and many other things) to a tier in front of your web servers. But my gut is you'll be I/O constrained on the server side. Good luck.
你考虑过json吗?与 xml 文件中的信息相同,但使用较少的文本来描述它。
have you considered json? same information as in an xml file but using less text to describe it.