使用Web服务传输大型有效负载的坏主意? [英] Bad idea to transfer large payload using web services?

查看:74
本文介绍了使用Web服务传输大型有效负载的坏主意?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

收集基本上,可以存储的数据量没有限制在通过POST或GET使用REST时发送.虽然我没有使用过REST或Web服务,但似乎大多数服务都涉及传输有限数量的数据.如果要传输1-5MB的数据(双向),Web服务是否被认为是一个坏主意?

I gather that there basically isn't a limit to the amount of data that can be sent when using REST via a POST or GET. While I haven't used REST or web services it seems that most services involve transferring limited amounts of data. If you want to transfer 1-5MB worth of data (in either direction) are web services considered a bad idea?

更新:我们正在考虑通过REST服务连接的应用是内部应用.我们确实可以选择其他连接选项(例如:RMI)

Update: The apps that we are considering connecting via a REST service are internal apps. We do have the option of picking other connectivity options (ie: RMI)

推荐答案

1-5mb,使用rest实际上并不是那么大的数据集.限制因素可能是内存.如果您的服务流量很高,则取决于生成xml的方式,服务器资源可能会不足.

1-5mb using rest isn't really that large of a dataset. The limiting factor is likely memory. Depending on how you are generating the xml, you could run low on server resources if you have high traffic on the service.

如果您使用的是流xml生成内存,则不会有太大的问题.创建一个dom树然后将其吐出来会占用更多的内存.

If you are using streaming xml generation memory won't be as much of a problem. creating a dom tree and then spitting it out will be much more memory intensive.

但是,即使您的dom树占用了原始xml的10倍的内存,您仍需要40个并发连接填充2gb的服务器内存.因此,根据您的情况,这可能不是问题.

But even if your dom tree took 10x the memory of the raw xml, you would need 40 conncurrent connections fillup 2gb of server memory. So it may not be an issue in your situation.

不太可能是客户端的内存问题.但是5在任何普通计算机上反序列化5mb xml转储都不是问题.

Less likely is memory issues on the client side. but 5 de-serializing an 5mb xml dump shouldn't be a problem on any normal computer.

这篇关于使用Web服务传输大型有效负载的坏主意?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆