views:

179

answers:

4

Hi,

Can Python be a good alternative to a web app that would otherwise be developed with JEE / J2EE? If so, which Python web app framework(s) may be a good choice? Please see details about the app below. I've asked a few people individually about this, who have worked for a good amount of time on either or both of JEE and Python web apps, and got a few answers that indicated Python might not such a good choice, mainly due to ease of scaling, which is one of the needs. The other reason given was relative lack of Python developers in the part of the world where the app is being developed. We might be able to overcome the second one, but not sure about the first.

The app in question is a financial domain B2B one, with a few different types of users (as in: "actors" having different real-life roles - e.g. buyers, sellers), some admin users, will use an RDBMS, will have CRUD (Create/Read/Update/Delete) plus search functionality for master tables, some types of transactions involving both master and transaction tables, (with fairly straightforward, not very complex logic), and some reports to PDF for most / all of the search screens (queries). Around 80 or so features, where the features mostly map to screens in the app; not all, though. It will have a few types of batch jobs too, for which the plan is to run them at times when the users are not permitted to use the app. Will have JavaScript and AJAX on the front end. Will have the feature of sending emails to users, not just for signup or resetting passwords, but for transaction-related info as well. No programmatic reading of incoming emails though.

The aim is for it to eventually to get a medium level of scale in terms of numbers of (paying) users and transactions, not very high, but not too small a number - say in the range of 10,000 users, of which 2000 may be concurrently accessing the app in a time frame of 15 to 20 minutes. It will be a SaaS (Software as a Service) app.

I know the question is very general and open ended and I expect some answers on the lines of "It depends" :) but still want to get some views from people who have worked on such things.

Feel free to ask more questions if needed to answer. I'll answer them except for anything that is confidential.

Thanks.

Edit 1:

Really appreciate all the answers. I will take a little time to think about them, and then get back with further questions (original, or in response to answers) or comments, if any.

+4  A: 

It's a very good alternative indeed. Your project sounds to me like it'll need quite a lot of custom programming, which in the Python world would point to basing your web app from Pylons ( http://pylonshq.com/ ). Pylons is mostly a glue layer, and you'll pick a template engine and ORM (try SQLAlchemy ( http://www.sqlalchemy.org/ ) for maximum power or SQLObject ( http://www.sqlobject.org/ ) for a somewhat simpler approach) layer of your choice. You will probably want to generate the PDF's using ReporLab ( http://www.reportlab.com/ ). For the email part, you'll get a long way with Pythons built-in email functionality (see docs at Python's own website).

Edit 1: you have almost certainly already thought of this, but..: success of course depends a lot on the competencies of the developers you have access to, i.e. if the know Python already, or are eager and quick to learn. I'd say Python is a very good beginners language, but it takes a little time to become really 'Pythonic' (roughly translatable as being proficient with Python's characteristics, e.g. using features like generators, list comprehensions, getattr and setattr etc fluently).

Edit 2: also, take a look at PyPI, the Python package index, http://pypi.python.org/pypi to 'window shop' for modules that'll provide additional functionality for you. There's a lot of them.

Jacob Oscarson
Thanks for your answer.
Anonymous
+3  A: 

Any language/framework is a good choice, if it is used properly by competent developers. Sometimes the best choice is the one with which your team is most familiar.

Given your client space though, if you want to move to a "higher productivity" framework, I suggest Grails. Its implemented in Groovy, which Java developers can pick up naturally, and has various tools for generating wars, which can be deployed in your favorite servlet container. It takes a lot of the pain out of tradition J2EE development, as long as you follow the conventions. It has a ton of robust plugins for things like authentication/authorization. It will save you a ton of time.

hvgotcodes
Thanks for your answer.
Anonymous
@anonymous No problem
hvgotcodes
+3  A: 

I think Python would be eminently suitable for your requirements, and you are likely to get the development done much more quickly than with a Java based solution.

There are several mature Python web application frameworks. Django is the most popular and will probably do much of what you want out of the box.

performance is unlikely to be an issue for the figures you give - any bottleneck is likely to be in the database access, so the speed of the language you use is largely irrelevant. Python is fast enough to run YouTube, and they have orders of magnitude more users than you will. (If you don't have time to watch the linked presentation, the lead scalability engineer at YouTube says that 99.999% of their application code is written in Python).

Dave Kirby
Thanks for your answer.
Anonymous
+2  A: 

Scaling is largely independent of your choice of language, but yes, python can scale just fine for what you describe. Plenty of large sites use Python, including reddit and youtube (here's a brief writeup on why reddit uses python).

Framework: Django is the a very popular framework, comes with nice admin capabilities built in, includes an ORM that speaks with the major databases, includes plenty of functionality, and has a vibrant community that churns out new apps and extensions constantly. We use it and like it.

For your AJAX/CRUD/Rest needs take a look at django-piston, a clean way to create rest based APIs.

Parand
Thanks for your answer.
Anonymous