Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asynchronous File Upload Servlet

Is it recommended to use asynchronous or NIO servlet for file upload? If so, a good sample code to start will do a great help for me.

I'd like to know which version of Tomcat supports Async / NIO servlet too.

like image 855
Kingsley Reuben Avatar asked Apr 11 '26 21:04

Kingsley Reuben


1 Answers

No...

...use the standard blocking IO stuff.

NIO does not automagically translate to 'faster' than old school blocking IO. In fact, many people have reported degraded performance with asynchronous NIO implementations for years, on top of the code being considerably more complex to code, understand, maintain and debug.

If that doesn't scare you off, remember two important engineering concepts:

  • Keep It Simple, Stupid!
  • Avoid premature optimization
like image 104
Stu Thompson Avatar answered Apr 14 '26 22:04

Stu Thompson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!