Rails or node.js for Restful API

I have an existing site written in ASP.net, I recently switched to Mac completely (from Windows to Boot Camp) and you need to write a public API to access the data of my MySQL site. First of all, I want to use the API to create an iOS application.

I'm interested in learning Ruby on Rails or Node.js, I haven't used them yet.

Which language should I learn?

+4
source share
3 answers

Rails is a relatively mature Ruby-based web environment designed to handle object portability with object binding in a relational database.

Node.js is much newer on the scene , and unlike Rails, it is a more bare-bones package that allows you to use server-side Javascript applications thanks to the rather tight HTTP (S) API. Node applications are inherently event driven , which may or may not be ideal for your application.

Since it seems to you that you need persistence of data (you mentioned access to MySQL data ...), it would be easier to get started with Rails, since it comes complete with all the things you need in this regard and is designed to facilitate this kind of application.

If you really don't need constant relational information, Node is probably better, as it stays in your way and allows you to decide how to handle things. It’s important to note that Node is a much more β€œcoding” structure than Rails, if you want something a bit higher level, but still easier than Rails, which runs on Node, express is a good place to start.

However, if you want to try Node (I confess: this is a lot of fun!), It is possible to access MySQL in a pleasant, event-independent manner . Here are two modules that will be useful:

+12
source

Also not a language; they are the foundation. There is no "better", maybe "more suitable" (maybe not in this case).

Which would you rather develop, Ruby (Rails) or JavaScript (node.js)?

Do you want to transfer this knowledge to another job without overclocking time (Rails)?

Do you want to learn something a little more esoteric, event driven (node.js)? (Ruby has an Event Machine, but IMO node.js takes this a bit further.)

+2
source

So this new application is just the average person between your ASP.NET and your other clients.

In this case, fully use node. Node is great for creating net glue. Node is great for IO-bound applications (i.e., it is a network intermediary).

If you are going to use Node, you probably want to look at express to simplify it.

+2
source

Source: https://habr.com/ru/post/1379009/


All Articles