Bad idea to transfer large payload using web services?

Marcus Leon picture Marcus Leon · Sep 30, 2009 · Viewed 16.6k times · Source

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?

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)

Answer

Byron Whitlock picture Byron Whitlock · Sep 30, 2009

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.