Why should we migrate from nodejs to Ruby on Rails?

Source: Internet
Author: User
Tags ruby on rails

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 those with a large numberShort-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 veryYoung technical frameworkIts 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 thatTest. 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, what we need isCache everythingAnd must be implemented 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, and 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.

Why we moved from nodejs to ror

Related Article

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.