What are the best uses for these 3 languages/frameworks? Is it useful to mix all of them (or 2)?
Node. js performs 20 times better than Ruby on Rails. Unfortunately, with RoR it is much harder to achieve the concurrency. It doesn't completely support asynchronous code and the performance is not that high.
Performance speed If we compare the speed of Ruby on Rails vs Node. js, even experienced Ruby on Rails developers acknowledge that the framework is slow. While its speed improves with every version, it's still a lot lower than Node's. There are many reasons for the performance delay.
js receives a CPU bound task: Whenever a heavy request comes to the event loop, Node. js would set all the CPU available to process it first, and then answer other requests queued. That results in slow processing and overall delay in the event loop, which is why Node. js is not recommended for heavy computation.
If you're building a complete web application, you should probably use Rails as it provides the most comprehensive services. You can also leverage an enormous amount of work produced by the community.
Sinatra is great for producing really thin, no-nonsense application services. You don't get much to work with, but it is very fast. If you need a database connection, you will have to add it in, and things like this can make creating even medium-sized applications a challenge. Basically if you need something very simple and don't need Rails, you probably need Sinatra.
node.js is a great new framework for producing responsive, scalable applications, but it doesn't have nearly the library of add-ons that a mature platform like Rails does. node.js really excels at applications based on streaming and on-demand data transformation. Some of the examples produced in Node Knockout are very interesting, but these were produced by some exceptional teams.
While the Node Knockout entries are very well done, when compared to the sort of applications that were produced in the 2009 Rails Rumble they seem to come across as toys lacking depth and complexity. This is not to discredit the work done by the Node Knockout teams, but it does show that the strengths of node.js are mostly to do with real-time events and less with conventional more ordinary DB-based apps.
Use Rails if you're working for a client and need some fast cash. If you want to enjoy coding your app and keep maximum flexibility and app speed, use Sinatra. It's easy to build large applications with it, people who say otherwise haven't used it.
Node.js is more like Rack, which Rails and Sinatra is built on, and doesn't really compare. Express.js, which you can use on top of Node.js, is comparable to Sinatra, there might be other frameworks that compare to the bloated Rails stack, google it. If you like coding async Javascript, use Node.js. It's also faster than Sinatra and Rails, but coding in Ruby has it's advantages since you can use lots of really nice ruby gems which makes life easy.
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