Choosing between Django-Apache and Java-Tomcat for a web application
Solution 1
Here are my experiences:
- Django-Apache fits in 16MBs of memory, whereas Java-Tomcat requires much more than that.
- Coding in Python is much faster, that is true. In Java, on the other hand, you have compile-time checks, profilers and debuggers that help you increase the stability of your application.
- If you are planning to do heavy computations or need complex data structures, Java's compilation technologies will provide the speed you need.
- It is easier to maintain a large project in a strictly object-oriented environment with advanced refactoring tools, such as Java.
- Then again, coding in Python is much faster.
Solution 2
It's worth noting that Python code can be extended with C/C++ code. So Django applications can, in fact, be faster than their Java equivalents if one is careful to use native code where speed or complex data structures are required.
Obviously, my vote's for Django.
Solution 3
I choose Python with Django, because it is better in deployment. You don't need build war. You only copy files on server and that's all.
Django is easily scalable and production stable. see this.
If you prefer Java look at Grails. But it has 2 minuses: building war and a lot of memory usage(200 mb without users).
viksit
The most common mistake people make when designing something completely foolproof, is underestimating the ingenuity of complete fools. - Douglas Adams, Mostly Harmless
Updated on June 19, 2022Comments
-
viksit about 2 years
In order to develop a web application that can easily scale, provide production stability, is easily deploy-able, and allows for fast development cycles, what points would you recommend I look at before choosing one or the other framework - using Java and Tomcat, or Django and Apache/Mod_WSGI?
Some pros and cons I could see immediately,
- Tomcat apps are simple to deploy - drop a WAR file and you're done. Django apps seem to need more wrangling (Not sure if creating .egg files and dropping them in would work as well?)
- Django's ORM seems much nicer than Hibernate - generates models directly compared to Hibernate's manual configuration files
- Python as a language is faster to develop in, and much more concise than Java can be. (Of course, this is a relatively higher level discussion).
I've looked at Disqus's slides about scaling Django and am under no doubts it can be done. But would scaling a Django app be any harder than scaling a Java/Tomcat one?
I'm familiar with both Java and Python and the frameworks mentioned above, and it boils down to getting feedback those who've worked with either (or both) on scale.
Thanks!
-
mindas over 13 yearsYour point about Hibernate's manual conf files is not complete. You can also implement ORM mappings using annotations.
-
viksit over 13 yearsBut the annotations still need to be manually typed out right? If I've got a table with 4 cols, Django will inspect the db and generate a pretty good skeleton class layout. With Hibernate, this needs to be done by the user. Correct me if I'm wrong?
-
mindas over 13 yearsWhat Hibernate does is completely opposite. Your code is the primary information source and according to mappings it creates DB structure (and updates if necessary), not the vice versa.
-
mike rodent almost 8 yearsJython? All the goodness of Java + all the goodness of Python. I know, it's only a utopian dream... but a good one.
-
Alex about 11 yearsThough it should be worth noting that this can make cross-platform support more difficult, as it's harder to install c extensions than pure python modules... Last i checked this was a deal-breaker for google app engine
-
Cedmundo over 10 yearsJava can perform C/C++ calls too. docs.oracle.com/javase/6/docs/technotes/guides/jni
-
ignorance over 7 yearsIf heavy computations are done with Numpy/Scipy, then I think portability is far greater than Java. IMO Python packages are easier to install than Java ones and Numpy is very fast.