Bad idea to transfer large payload using web services?

孤人 提交于 2019-11-30 17:32:47

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.

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.

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.

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.

1-5 MB is okay, as long as you provide the user with some sort of progress feedback. Webservices run over HTTP, which is okay-ish when it comes to overhead on larger datasets, the real problem is XML. XML, more often than not, adds a huge overhead to the size of the serialized data. I'd consider JSON or Hessian for larger datasets :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!