I am wondering how to integrate node.js on a rails app (for learning purpose).
Based on Michael Hartl tutorial (http://railstutorial.org/) I realized a basic twitter clone with rails and want to get user microposts in real-time without the use of comet or juggernaut. (the application is hosted on heroku)
For the moment, I only see example with node.js frameworks (http://howtonode.org/grasshopper-shoutbox) but nothing merged with a ruby on rails app. I would be very thankful if someone knows a good tutorial or give me some points to start in order to accomplish this.
Thanks!
Contrary to Node. js, Ruby on Rails is a framework created to make the development process faster and easier without bottlenecks within the processes. The framework is written in Ruby, which is a multi-purpose language.
Node. js takes more time, as you need to find the modules and follow the instruction for integrating them. Ruby on Rails seems to be faster, as you can perform some task, like database migration, with just a few commands. The learning curve is partially less than with Rails.
4. Development Time Ruby on Rails also wins when it comes to development times. The web app development framework consists of an integrated webserver. Moreover, it consists of a large library of scripts and generators. As a result, website development is much easier with Ruby on Rails as compared to Node.
JavaScript is perfect for developing low-latency applications as you do not need to wait for the completion of functions. Ruby on Rails doesn't fully support asynchronous code and has a slow CPU processing time.
As Shripad said, I'd consider trying to build your app with Node by itself. Geddy will feel familiar (getting started anyway) if you have experience with Rails. Note: I do not have experience on a real world app with Geddy, but it is the best Rails-like framework I've seen so far. For persistence you can use SQLite, PostgreSQL or CouchDB, just like you would with Rails. I thought about how to communicate between a Rails app and Node without any intermediary. In our work project we're using Redis as an intermediary between Rails and Node. Rails publishes messages to Redis, Node pulls messages from Redis. I could not find a good way or example projects to avoid the middle communication layer on a personal project, so I went with the same setup. The good news is Node Redis modules are written and once you get everything installed, it is easy to test out pushing messages back and forth.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With