Why is Sparkjava not suitable for production?

Thanks for asking such a good question and I don't suppose there is a simple yes or no answer to it directly. Let me start with we have been using Java Spark for microservice development for quite some time now. The challenges which faced during our run with the framework

  1. There is not a lot of material available on the internet for Java Spark as compared to other frameworks like Spring Boot, restlet. So most of the times if you are stuck you are the one who has to solve the problem.

  2. There is no dependency-injection. We had to use Spring in conjunction with java Spark to get this feature.

  3. There is not enough information available on the internet when you want to integrate your microservice with service discovery tools or API gateway.

  4. Integrating Spark with swagger was a mess. It took us days to figure out how we can do.

  5. As it is still evolving and has a long way to go we dont prefer an framework like this in prod.

All that said, it is super easy to create a microservice application on spark java. Kudo to them!!!

Please refer to below links for more info:

  • https://www.gajotres.net/best-available-java-restful-micro-frameworks/

  • https://cdelmas.github.io/2015/11/01/A-comparison-of-Microservices-Frameworks.html


That's all a matter of choice. Spark is intended to be very simple and minimal dependencies are required to get a web app up and running. Spark allows us to build a web app by using only the JSE8 platform, while most of the other existing technologies would require JEE, what would end up increasing a lot the learning curve for using them.

When it comes to deploying your app, be aware thar most of the cloud servers and hosters doesn't support the lean framework Spark out of the box, so that you'll end up having to implement a deploy strategy by yourself. But you can easily deploy an Apache or a Java EE app on such services, and Spark can be easily wrapped in an Apache or JEE web server as described in the documentation