When comparing Koa vs Java, the Slant community recommends Koa for most people. In the question“What are the best backend web frameworks?” Koa is ranked 33rd while Java is ranked 42nd. The most important reason people chose Koa is:
Using generators (a bleeding edge feature, even for Node.js) would clean up your code from the mess caused by all those callbacks; making your code more manageable.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Generator support from ground up
Using generators (a bleeding edge feature, even for Node.js) would clean up your code from the mess caused by all those callbacks; making your code more manageable.
Pro Extremely lightweight
Koa is very lightweight with just 550 lines of code.
Pro async/await keywords are supported and has transcended beyond generator functions
Generators functions are of course a huge plus, but at the time Koa team has transcended generations functions and shifted towards async/await style programming. It has made the Koa best framework available in the market.
Pro Development team has a proven track record
Koa is developed by the team behind a widely used node.js framework (express.js).
Pro Built for ES6
Pro Verbosity
It makes it easy to debug and to read code.
Pro Mature ecosystem
The language and all its tools have enough time to age and they've aged well.
Pro Type-safe
It is easier to catch errors sooner.
Cons
Con Community is relatively small
Con Not compatible with express style middleware
Koa uses generators which are not compatible with any other type of Node.js framework middleware.
Con Has no routes separated by HTTP method or URL pattern
Con Wrong Middle ware, security issue
Con Memory hungry
Running the virtual machine, application server and application itself consumes significant amount of resources.
Con Unnecessarily obtuse and verbose
If you like typing 40 lines of code to open a file, Java is the language for you. If, on the other hand, you’d actually like to get something done, look elsewhere.
Con Oracle
Enough said.
In more detail: Oracle has acquired Java from Sun and continues to surround it with controversy ever since (legendary lawsuit with google, money extortion from the enterprise users etc.).