I am developing an application similar to fb chat. What structure - play or django?

I really like Python. I am “good” with Java with good Android experience (but we all know that most of the things in Android are covered so well in many blogs that the learning curve is actually not that steep.) So, a return to the Internet application. This is what I expect: -

  • A lot of requests. (Scalability.)
  • Concurrency.
  • Adaptive.
  • Good bug reporting.
  • Less steep learning curve.
  • It goes well with PostgresDb and Redis.
  • Provides some way to create a cleaner apis (something like a django piston.)
  • Last but not least, I have a period of time of 2 months to complete it. (Not a prototype, but the final version.)

Edit:

Node.js seems exceptionally good for creating a quick prototype, but is too small to grow.

PHP is a language in which I have never found myself convenient to enter code. In JAVA, I was not comfortable until I received the Android encoding. Therefore, Scala is preferred. In addition, I found out that fb chat was built on Erlang. And I believe that because of something wrong in fb, one of the few things that is correct is their stack and preferences of certain languages ​​/ frameworks to fulfill their functions.

I am a noob in Scala, but I do not find this language complicated. I looked at quite a few blog posts about Play vs Lift, Web dev in Scala, the advantages and disadvantages of Scala, and many similar things. The only reason I'm switching to Scala is that I'm terribly angry with Python concurrency and how much it doesn't scale. (I'm a big fan of twisting and use it for millions of other things, but I just "Think Django / Rails is disabled to deal with a concurrent, stable, responsive web application.)

My question is here, am I mistaken? Should I jump on Scala, taking all this into account? I really hope to get good answers because I don’t want to spend long frustrating hours getting a skeletal version of my web application and then I understand that it does not scale. Also, what would be the preferred stack? What does the industry use? (I know a lot of questions, but it's scary to switch from Django / Rails to something else.)

Any help would be greatly appreciated.

+6
source share
3 answers

I just started to learn the game in the last few days, and I like it. It has all the advantages of Java (for me it is related to machine learning) with all the beauty of an easy-to-use MVC structure.

Play has excellent support for web sockets and has a great chat application that you can play to find out if it matches your account.

https://github.com/playframework/Play20/tree/master/samples/scala/websocket-chat

+13
source

Picking up the previously mentioned geee approach from sweemeng: Follow him. This is even related to the possible integration of Django using gunicorn. Here are some articles to help you get started and get your idea:

Good introductions:

Code example:

Deployment and libraries:

+3
source

Not sure about django integration, but gevent can use websocket, and long polling is a well-known gevent template. You can use this as a start to develop such an application.

You can also use tornadoes, but I am not familiar with this.

In addition, this is a project from my friend that integrates django with a tornado and their plug.io-plugin https://github.com/felixleong/tornadio-with-django

+1
source

Source: https://habr.com/ru/post/919823/


All Articles