I have little experience in python and intermediate experience in java, I'm not sure if I should continue in java and learn Spring since it seems old and I'm thinking of moving to Django, can someone summarize the Pros and cons of each framework?
Videos
Can Django and Spring Boot be used for cloud-based applications?
Which framework is easier for beginners: Django or Spring Boot?
Should I learn Django or Spring Boot in 2025?
My friend and I are starting a company of our own, where we develop software products that offers services to other companies and institutes.
We are in the phase of deciding what technologies and frameworks to use. For the back-end we are trying to choose between Django and Spring. Here is what we have come to:
Spring
Pros:
Simplified & version conflict free dependency management through the starter POMs.
You can just assemble the jar artifact which comes with an embedded Tomact, Jetty or Undertow application server and you are ready to go.
Offers better support for micro-services.
Cons:
Spring boot may unnecessarily increase the deployment binary size with unused dependencies.
spring Boot applications can range in size from 50 MB โ 250 MB, if not larger. (99% is dependency JARs)
Spring promotes Dependency Injection (DI). But if you start using Spring, your project becomes dependent on Spring framework. This is a dependency that you are creating for your project. You may not be able to come out of it in the future.
Django
Pros:
Easier and faster deployment.
Smaller in size
More secure
Ability to integrate things like machine learning
Cons:
Not good with micro-services, Django really shines in an environment in which you can make use of all the included โbatteriesโ, Django ORM + Admin + Generic Views.
Tightly coupled
can you offer more suggestions and provide feed back ?
Thank you.
Spring:
-
Is Java
Django:
-
Is Python
Those are the only criteria you're going to want to use in this comparison. Do you want the libraries from the Java ecosystem or from the Python ecosystem to better support your backend?
Neither is a great choice for a microservice architecture. If that's a requirement for you, you've chosen your comparison poorly.
There are a lot of quality of life things that would make me recommend Django over just about anything else (Django migrations vs Hibernate chaos would be a big one for me here, or faster development reloading), but at the end of the day my quality of life matters a lot less than the product we can deliver without excessive development times. That's going to come down to the ecosystem. There's no Jython for Python 3, so you can't use the latest Django now or any supported Django version on a JVM in early 2020.
Use the stack you know best.
If you know both equally well, decide per-project: use the one that makes more sense for the specific project.
From the perspective of developing Web applications, there's only the big difference in the approach towards the architecture of your applications.
Django tends to impose a lot of constraints and depends heavily on a fixed set of solutions that are provided internally. What you get from that are conventions and a streamlined approach to how you're developing your applications. Most of the framework solutions work for everybody and when they don't, you have plenty of opportunities to either extend or reuse certain components differently. This works out so well that, really, once you've seen one good Django project you've seen all of them.
Spring, on the other hand, tends to impose as little constraints as possible. Aside from satisfying Java EE platform requirements, you're at the liberty to pretty much wire your application in any way you'd see fit. The components that you write to provide actual behavior are intended to be as loosely tied to the framework itself and you'd just end up using certain components provided by Spring to manage how they're discovered, wired, managed and consumed. The problem is that you're at the liberty to customize even the most minute aspect of the application, which means that you'd be making a lot of decisions and every Spring Web application will be uniquely designed.
Spring has its own web MVC framework, but it's much more:
- A dependency injection/inversion of control factory
- Aspect oriented programming.
- Modules for persistence, remoting, and other features.
Django is a Python web MVC framework for creating browser UI CRUD applications.
I would say that Grails, a Ruby on Rails-like web CRUD framework for Java that's based on Spring, Hibernate, and Groovy, would be a better analogy for Django. Both use "convention over coding" to speed development along.
Everyone needs a job to pay for bills and buy stuff. So I have been driving into python and it's libraries and got started with flask and django. Also it is quite useful in AI as well, so that's also a reason. (I could just import libraries and do stuff and learn and build along the way)
It is not a matter of whether I should I do django or springboot but of to which to dedicate the most time so that my learning could be the most fruitful. I'm 21 of age.