Why do we migrate from NodeJS to Ruby on Rails

original
2012/07/12 12:39
Reading number 680

statement : This article is by no means a discussion NodeJS And Ruby on Rails. It only describes some thoughts and reasons behind our decision-making process. Both frameworks are excellent, and both have accomplished their original design goals. This is why some of our modules still run on NodeJS.

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

The reason why we used NodeJS to develop it was simple. I have a package that can quickly bring our application online (we spent 54 hours doing this). Compared with Ruby, I use JavaScript more often. Because our technical architecture involves MongoDB, my expertise will be meaningful only in the NodeJS environment. However, with the growth of the application scale, I realized that choosing NodeJS to implement this application is a wrong choice.

Let me summarize the reasons.

NodeJS is very suitable for many Short life request Application of. For traditional CRUD applications, it is also very good, but not very ideal. stay PHP Ruby and Python have mature and optimized frameworks to handle this kind of application. The idea that everything in NodeJS is executed asynchronously has no effect on CRUD applications. Popular frameworks in other languages can provide very good caching technology, and all your requirements can be met, including asynchronous execution.

NodeJS is a very Young technology framework Its peripheral libraries are not very mature. I don't mean to offend those code donors. They are excellent and have developed many excellent libraries. However, most of the libraries need to be improved, and the fast-growing environment of NodeJS means that there are a lot of changes in each version of the upgrade; When you use a cutting-edge technology, it is very necessary for you to keep up with the latest version as soon as possible. This has brought a lot of trouble to entrepreneurial enterprises.

Another reason is about test The test framework in NodeJS is good, but it is inferior to that on Django or RoR platforms. For an application that has a large number of code submissions every day and is about to be released in a day or two, it is vital that the program should not go wrong, otherwise your hard work will be more than rewarding. No one wants to spend a day fixing some retarded bugs.

Finally, what we need is a kind of energy Cache everything And we should realize it as soon as possible. Although our applications are growing, with tens of thousands of hits per second, there will never be a large number of access requests; This is not a chat program! The main program can reach 1000 RPS at most, which is not a big load for Ruby on Rails and Nginx.

If you are still reading this article, you have seen all I have to say. You may be very insistent on knowing where our application is still using NodeJS. Well, our application consists of two parts. The first is the interface, which is the part that users see. The second is the part responsible for report management and the function of making logs. 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 completed as soon as possible, even before our data push is completed. This is very important. When the request execution is not finished, the browser will continue to wait for the end of the response, which will affect the user experience. The asynchronous feature of NodeJS saved us. The data is either stored in the database or processed. Once the request is completed, the browser can start to do other important things.

Link to the original English text of this article: Why we moved from NodeJS to RoR

Expand to read the full text
Loading
Click to lead the topic 📣 Post and join the discussion 🔥
Reward
zero comment
zero Collection
zero fabulous
 Back to top
Top