Live data from Hacker News

Why we moved from NodeJS to Ruby on Rails

blog.targeterapp.com

31–40 of 166 posts

Re: Why we moved from NodeJS to Ruby on Rails

#31

Does anyone know 1 major consumer-facing site that was able to scale with Rails? I know Twitter kind of had to move away from Rails due to scalability issues. GameBattles.com also had to back away from Rails after their uptime dropped to 80%. I am not trying to tarnish Rails, I am just curious to learn about some success stories involving Rails at very large scale.

I'd like to know this as well. Some of my Coworkers went to RailsCon a few weeks ago and were remarking how a speaker talked about how they scaled from tens of thousands of hits a month to a couple hundred thousand hits a month. Not very encouraging when that's the sort of traffic we get in an hour and the solution was to use nearly double the amount of web and memcached servers than we do now on our PHP stack.

You can't compare servers to servers. Each app has its own computational needs and caching rules. Your hit is not my hit. One site might simply render a template, another might perform 20 queries and generate giant complex docs.

Re: Why we moved from NodeJS to Ruby on Rails

#32
Basically they switched for... personal opinion. That's all I can really gleam from the post. You can do it all in Node JS, they just didn't want to.

Screw all the frameworks, I am working with bare-metal Node and loving every minute.

Re: Why we moved from NodeJS to Ruby on Rails

#33

Earlier quoted context omitted.

I'm writing a server in Node and to date I'm still trying to figure out how to control the main loop from Node. I want to write tests like this: 1. register some timers and create some sockets 2. send some stuff over the sockets 3. wait until the socket handlers received some data which cause the handlers to unregister the sockets and timers 4. at this point, the main event loop has ended. go to next test and setup a…

#3 I'm not undestanding. Are you doing async? I don't know the socket API but it should be something like this: it("should wait for socket", function(done) { socket.write("asdfadf", function(err, response) { assert.ok(response.indexOf('token') >= ); done() ); }); #4 If you need a new event loop then write the tests in another module, then simply run your test utility. `mocha` will run all tests in test/*test.js. RSpe…

>RSpec is DOG SLOW! I can run 100s of test in a couple of seconds. Can RSpec even startup in that time?

Yes, of course it can. RSpec is not especially slow. Obviously the ruby interpreter can be slow, for any given rspec test you could write something faster in C or Java or Go or whatever. That's irrelevant.

I'm guessing you're referring to rails tests, where the whole rails stack has to be loaded with each run of the test suite, something that is notoriously slow. There are strategies to avoid this.

Also it is very easy for the naive rails developer to write tests with extremely inefficient usage of the database, which creates horrible bottlenecks.

Re: Why we moved from NodeJS to Ruby on Rails

#34
post #22

Does anyone know 1 major consumer-facing site that was able to scale with Rails? I know Twitter kind of had to move away from Rails due to scalability issues. GameBattles.com also had to back away from Rails after their uptime dropped to 80%. I am not trying to tarnish Rails, I am just curious to learn about some success stories involving Rails at very large scale.

AFAIK Twitter still uses Rails for at least part of their app, perhaps just not for directly serving consumer requests

I'm pretty sure they still use Rails for the HTML application that you see when you visit twitter.com - it's the backend stuff (the data storage layer, the message queues, the API etc) that's been ported over to Scala/Java.

Re: Why we moved from NodeJS to Ruby on Rails

#35

I wonder what testing functionality, specifically, they see missing in the Node ecosystem...

I'm writing a server in Node and to date I'm still trying to figure out how to control the main loop from Node. I want to write tests like this: 1. register some timers and create some sockets 2. send some stuff over the sockets 3. wait until the socket handlers received some data which cause the handlers to unregister the sockets and timers 4. at this point, the main event loop has ended. go to next test and setup a…

Check out tap, it has a very simple api that works well for testing asynchronous code: https://github.com/isaacs/node-tap

Here's a tap example that sets up a server and client for dnode: https://github.com/substack/dnode/blob/master/test/single.js

Timers usually aren't necessary with test harnesses like tap or nodeunit since you need to call `t.end()` explicitly or else `t.plan()` the number of tests that are supposed to be run. If a different number of tests actually run or assertions fire after `t.end()` is called, those are reported as errors.

For (4), to run a bunch of test files in a directory you can use the `tap` command. You can even add something like `tap test/*.js` to the scripts.test field of a package.json file and then to run all your tests you can just do `npm test`.

Re: Why we moved from NodeJS to Ruby on Rails

#37

The author seems to be confused about what Node.js is. > NodeJS is a very young framework, and packages around it are very immature. Node.js is not a framework. It is a JavaScript engine and standard library. Node is comparable to the MRI.

A standard library is nothing but the default framework built into the runtime system.

Re: Why we moved from NodeJS to Ruby on Rails

#38

The author seems to be confused about what Node.js is. > NodeJS is a very young framework, and packages around it are very immature. Node.js is not a framework. It is a JavaScript engine and standard library. Node is comparable to the MRI.

First thing is that NodeJS is not a JS engine, V8 is. Second, http://notinventedhe.re/on/2011-7-26. That is from http://nodejs.org/community/ which makes the terms quite right, i'd say.

Re: Why we moved from NodeJS to Ruby on Rails

#39
post #32

Basically they switched for... personal opinion. That's all I can really gleam from the post. You can do it all in Node JS, they just didn't want to. Screw all the frameworks, I am working with bare-metal Node and loving every minute.

"You can do it all in Node JS"

People like you scare the shit out of me. Golden Hammer is a new concept to you, isn't it?

He actually did lay out the reasons, but your religious zealotry won't let you see it because someone isn't loving your sacred choice of technology.

Re: Why we moved from NodeJS to Ruby on Rails

#40
post #38

The author seems to be confused about what Node.js is. > NodeJS is a very young framework, and packages around it are very immature. Node.js is not a framework. It is a JavaScript engine and standard library. Node is comparable to the MRI.

First thing is that NodeJS is not a JS engine, V8 is. Second, http://notinventedhe.re/on/2011-7-26 . That is from http://nodejs.org/community/ which makes the terms quite right, i'd say.

Node is V8 and a standard lib. Node is not an abstraction around http (which is what RoR is).
Post reply on HN