Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django alternatives for real time web applications [closed]

I've been developing a web server application with Django for the last year. The stack is Django + Apache + MySql. This stack was perfectly suited to our needs. Recently came the need of some real-time capabilities and the opportunity to change/rewrite a lot of stuff in the server application. To my surprise, Django is not the best option here.

I've been reading a lot (push, WebSockets, gunicorn... lots of stuff.. http://curella.org/blog/django-push-using-server-sent-events-and-websocket/) but I haven't managed to decide if I want to go with Django or if I should purpose a new stack of software which is more suitable for the job. Going with Django seems a little bit unnatural. Can any experienced developers point me in the right direction?

So, the basic question is: what are some alternatives to the current software stack I have for building a real time web application?

Thanks

PS: Not a native English speaker. :)

EDIT: The alternatives need to allow secure connections.

EDIT 2: The web applications we develop are games.

like image 364
luistm Avatar asked Jan 30 '13 09:01

luistm


3 Answers

Look into http://www.tornadoweb.org/ + http://www.mongodb.org/ + https://github.com/bitly/asyncmongo + http://socket.io/ I think it's a good idea to use that to create real-time application.

like image 61
inlanger Avatar answered Oct 26 '22 01:10

inlanger


You need to weigh your decisions against your goals.

You want a product

Then write your code in the language framework that you are most familiar with, only when you have a product and it has limitations consider switching tools.

You want to learn something new

Try out the new language, framework - but it may take a lot longer to produce a product and you may find that the new tool isn't any better than the old one.

Half and Half

Try starting two projects, and building the same thing in each project, just using the other tool. This will take even longer, but you should be able to see which tool you prefer / is best suited to your task very quickly.

Alternatives

I'm not quite sure what you mean by django is 'unnatural'. Django can do server / client communication - just use some AJAX to talk back to the django server, then call another pythonic library to process the request. Python alternatives to django include the wonderful flask and web.py, though neither will do client / server communication unless you program them too (like django). If you're not into python you might try ruby on rails. For the client side you will need to know something about JavaScript so go and learn up on that (coffescript and jQuery can ease JS pain, but do learn JavaScript first).

Of course you could bite the bullet and go with node.js as the server base, apparently it's pretty good (I've not tried it yet) - and written in JS.

EDIT: In light of your comments, take a closer look at

  • django-websockets,
  • node.js + push server
  • websockets

Noting also that this question is a potential duplicate.

like image 42
danodonovan Avatar answered Oct 26 '22 02:10

danodonovan


For the real time web applications I suggest that you go with the websockets, they can be secure and response times are very fast as when connection is made there are no overheads in communication anymore. If you are proficient in python you can make server in python twisted and clients in python and/or javascript using autobahn. P.S. here is a really great tutorial for twisted.

like image 1
Bula Avatar answered Oct 26 '22 03:10

Bula