Comparison between Rails and Node. js, PHP, and Python

Source: Internet
Author: User
First of all, this is not a comparison post. Can the language and framework be compared? Secondly, I have never used it all. the only purpose of this article is to remind me that this is not a comparison post. can I compare the language and framework?

Secondly, I have never used it all.

The only purpose of this article is to remind yourself (and you are still browsing) what you really need to pay attention

PHP
PHP is a simple but dirty language. simple refers to a low learning curve, mainly because of a large number of php-based dummies, such as wordpress and discuz, if you only need a blog or forum, you do not need to write a line of code if you use google. But is php simple? I personally think it is not. The reasons are not listed one by one. As for dirty, I think it's about his design. The Language design is poor. When I look at the name of a function that is often connected by an underscore, I just have a glimpse of it. apart from experienced php programmers, it is difficult for someone to write code that does not have serious vulnerabilities.

Php development framework recommendation: First Class: Yii, Yaf, Symfony; second class: Zend, Cake, CI

Django
Django is a Python-based web development framework. it is very similar to Rails. a few years ago, what makes Django better than Rails was that Python is more "reliable" than Ruby. The so-called reliability means more people use it, more documentation, more answers can be found through inquiry, but with the rise of Ruby in recent years (mostly driven by Rails), more and more websites are using Rails. In the single-theory language design, Python is not necessarily simpler than Ruby, and its consistency is slightly inferior to Ruby. it can be said that the only advantage of Python is that many serious scientists are using it, it occupies more than half of the field of scientific computing, while Ruby is made in Japan (Ruby uses Python for reference ). If Ruby is a language born in the European and American countries of the same generation as Python, I believe there is no Python thing now.

Rails
Rails is an amazing web framework. almost all mainstream web frameworks can see the shadows of Rails. Rails has used Ruby's features to the limit. Rails can be applied to all large and medium-sized applications. ultra-large scale applications are not competent by any scripting language alone. After years of development, Rails has been fully developed and is now in a state of unique advantages. it can be said that it does not have the comprehensive capabilities of a framework (ease of use, profile, efficiency, learning curve, etc) it can surpass Rails, NodeJS, Django, and other "niche" languages. On the contrary, Rails is in rapid development, and success stories of ultra-large scale applications will also appear one by one in the future.

NodeJS
NodeJS is a promising Web framework. Unfortunately, it has been a few years late, or it is still able to compete with Rails, compared with php, Django, and Rails, nodeJS has fewer open-source projects and fewer success stories, but its design and performance are also quite concise and efficient. I believe that the future will shine brightly.

ASP, JSP, etc.
Complicated, bloated, enterprise-level companies, state-owned enterprises, banks, e-commerce companies, and entrepreneurial companies that rely on mass numbers commit suicide. Other words that are not needed by important departments also commit suicide (recruitment is not acceptable, only after-sales services are available ).

Others
Other languages have their own purposes, but businesses just use the language. Strictly speaking, they cannot be specialized in network development, such as Clojure and Io. We will not discuss it here for the time being.

Summary:

If I want to select a Learning Path (only language, not server or db) again, I will

Learn more about php.

Take a look at Yii, a php MVC framework.

Basic Ruby learning

Basic Rails learning

Complete Ruby learning

Thoroughly learn Rails

Understand Python, Django, Lisp, Clojure, NodeJS, etc.

------------------------- Split line ------------------------------

This article describes the applicable scenarios of rails and nodejs very well. Rails and nodejs are two of the most noteworthy background technologies.
Statement: This article is not an article about NodeJS and Ruby on Rails. It only describes the reasons behind the thinking and decision-making in our decision-making process. The two frameworks are both excellent and both of them are well designed. This is why some of our modules are still running on NodeJS.

I am a big fan of NodeJs. I think this is a very exciting technology and I believe it will become more and more popular. I really appreciate this technology-although we recently migrated the Targeter App from NodeJS to Ruby on Rails.

The reason why we used NodeJS to develop it was very simple. I have a package that can quickly bring our applications online (we spent 54 hours doing this). compared with Ruby, I often use JavaScript. Because our technical architecture involves MongoDB, my skills only make sense in the NodeJS environment. However, as the application grows, I realized that choosing NodeJS to implement this application is a wrong choice. The following describes the causes.

NodeJS is suitable for applications with a large number of short-lived requests. For traditional CRUD applications, it is also very good, but not very ideal. PHP, Ruby, and Python have mature and optimized frameworks to handle such applications. The idea that everything in NodeJS is executed asynchronously has no effect on CRUD applications. The popular frameworks in other languages can provide excellent caching technology, and all your requirements can be met, including asynchronous execution.

NodeJS is a very young technical framework, and its peripheral libraries are not very mature. I didn't mean anything to offend code donors. they were excellent and developed many excellent libraries. However, most libraries need to be improved, and NodeJS's rapid growth environment means a lot of changes in every version upgrade. when you use a cutting-edge technology, it is imperative that you keep up with the latest version as soon as possible. This brings a lot of trouble to entrepreneurial enterprises.

Another reason is about testing. The test framework in NodeJS is not bad, but it is worse than that on the Django or RoR platform. For an application that has a large amount of code submitted every day and will be released in a day or two, it is critical that the program cannot go wrong. Otherwise, your hard work will not be worth the candle. No one is willing to spend a day modifying mentally retarded bugs.

Finally, we need something that can cache everything and implement it as soon as possible. Although our applications are growing and there are tens of thousands of hits per second, there will never be a large number of access requests; this is not a chat program! The maximum load of the main program is RPS, which is nothing for Ruby on Rails and Nginx.

If you are still reading this article, you have read all what I want to say. you may insist on knowing where our application is still using NodeJS. Yes, our application is composed of two parts. The first is the interface, which the user can see, the second is the report management section, and the log function. The latter is an optimal use scenario for NodeJS. There are a large number of short-cycle requests. This part of the action needs to be executed as soon as possible, even before our data push is complete. This is very important. when the request execution is not over, the browser continues to wait for the response to end, which affects the user experience. The asynchronous feature of NodeJS saves us. The data is either stored in the database or processed. Once the request is executed, the browser can start to do other important tasks.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.