Live data from Hacker News

Why we moved from NodeJS to Ruby on Rails

blog.targeterapp.com

121–130 of 166 posts

Re: Why we moved from NodeJS to Ruby on Rails

#121
post #15

Earlier quoted context omitted.

The point is that the rack middleware would be called for everything, which is very heavy for something so trivial

I didn't mean to imply that NodeJS isn't the best fit for the problem at hand. I was just trying to clarify that it doesn't take an asynchronous framework like Node to keep processing a request after the connection is closed.

Yeah, even with a simple Perl CGI, all you have to do is close STDOUT if you want the HTTP response to end, but continue processing the request.

Re: Why we moved from NodeJS to Ruby on Rails

#122
post #118

Anyone else find it ironic that this post is about moving from Node to Ruby in order to produce the admin interface to a Java hosting service? (This was a blog post written by "Jelastic" devs, who make a Java PaaS product). We seem to be seeing more of this "don't eat your own dogfood" approach to software development lately. The other example that comes to mind is the Play Framework, written in Python and also targe…

I see what you mean by ironic, but it might be a bit less ironic when you consider the history of the name "JavaScript." Its original market positioning was as a lightweight complement to the heavier Java. Now we have other languages serving in that capacity as well: Python, Ruby, Scala, etc. I don't know if there will someday be a language that is as easy to work in as a Python or Ruby for simpler programs but which…

[deleted]

Re: Why we moved from NodeJS to Ruby on Rails

#123
post #56

Earlier quoted context omitted.

I use node for everything now myself for a number of reasons. The "problem" with node is that its still very young. And its a different programming model then people are used to. So its similiar to the whole RDBMS/document store argument. You use what works for your applicaiton. The thing that annoys me personally is that they make it seems like there something wrong with node. And there isnt at all.

Does it provide any of the functionality that you get with a Django/Rails style framework? Or is it at a lower level?

There's are some web frameworks that are aspiring towards Django/Rails-style, but none that have a similar ecosystem of plugins and developers yet.

The most popular web framework, express.js, is a bit more lower level, and is similar to Werkzeug from Python or Sinatra from Ruby.

Re: Why we moved from NodeJS to Ruby on Rails

#124

Since our stack involved MongoDB, it only made sense to live in a JS only environment. I've never used MongoDB; can someone explain to me why this would seem like an advantage, and/or what it has to do with MongoDB? Is the MongoDB API simply JavaScript?

I didn't understand that either. MongoDB works very well with many other languages; just recently I was using it with Python, and the driver and API work very well. I guess since MongoDB stores data in BSON, which is the binary version of JSON, the javascript object format, the author decided that JS is closest in spirit to Mongo.

The mongodb shell uses javascript, and stored functions and map/reduce functions and more all use javascript. So if you use mongodb, you'll be using quite a bit of javascript anyways.

Re: Why we moved from NodeJS to Ruby on Rails

#125

Since our stack involved MongoDB, it only made sense to live in a JS only environment. I've never used MongoDB; can someone explain to me why this would seem like an advantage, and/or what it has to do with MongoDB? Is the MongoDB API simply JavaScript?

Mongodb is a json document store. I use it myself. It works very well with "node" because node of course uses javascript as its language.

It's not JSON, it's BSON. BSON supports more data types, which are needed for a proper database (such as object IDs, longs, doubles, binary data, references, etc.)

You still need a driver and a bson serializer if you use node.js.

Re: Why we moved from NodeJS to Ruby on Rails

#126
First of all I would like to say that I'm no fan of these 54/whatever hour coding rushes, I think it makes people go too fast with poor planning and NO time for testing anything, even for developing looks short, I would rather take my time to plan anything before writing a single line of code.

About Node I have played with it and it looks nice but at the end of the day I just returned to Java and PHP (can't talk about ruby never tried and not sure when I will), why? First, all the Node talk seems to revolve around the hype it generated recently, why I don't know. The idea of the async is nice but stall it with something that takes long to process (and needs to send a response) and you are screwed just like any other language, but I think node may be worse as far as my understanding goes its a single thread dispatching stuff (am I right? please correct me on this if I'm wrong).

Libraries for it, there seem to be too many of the same kind all of them with different ways of working that is not easy, and when I tried it none did what I wanted.

Re: Why we moved from NodeJS to Ruby on Rails

#127
post #70

Wow, Node is being turned away from because it's too new, and Rails is the destination because it's established? I remember a few years ago Rails using the argument of re-inventing the wheel was the only way because there was presumably no other capable web framework out there. We all know better now and I hope celebrate choice that's relatively equally capable :)

And people switched away from Rails back then too :-)

http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_swit...

Re: Why we moved from NodeJS to Ruby on Rails

#129

Earlier quoted context omitted.

OP explained things improperly, then. It's an important detail, because Rails currently defaults to single-threaded. This makes an operation such as fetching and returning a twitter feed in a single request (assuming it takes hundreds of milliseconds to get a response from twitter's servers) expensive.

Only rookies do that inside the web server process. The job of fetching a Twitter feed can be offloaded to a background jobs queue. With a little help from Nginx, you can free the Ruby process to take care of other requests until the response of that Twitter feed is ready. Or you could simply deploy your Rails app on top of a Java server, by means of JRuby and forward that request to a servlet that uses the continuat…

Or you could just use node.

Re: Why we moved from NodeJS to Ruby on Rails

#130

Earlier quoted context omitted.

Well in Java, if your JSON library doesn't have a single function to call for deserialize or serialize, it's either a poor library or you should be able to wrap the complicated part in a function that makes it a one-liner. The Jackson library for instance has ObjectMapper.readValue() and ObjectMapper.writeValue() which are both one-liners. My main point though is that writing in JavaScript doesn't naturally make it e…

I'm not a Java coder so I'll take your word on it about library support, I've only used the JSONObject, JSONArray, etc. classes. Surely you will concede that JSON being modeled after JavaScript gives the language a little bit of a leg up?

Not really. In theory, it's an advantage in that you can reuse the parser and avoid loading another, but in practice, that's only really important in the browser, not on the server, where the lib will be permanently loaded anyway.

And JSON values map 1:1 to native data structures in most languages - in fact, JSON can be parsed as Python code with the exception of the \/ escape.

Post reply on HN