Search code examples
angularjsscriptingserver-side

server side language to suite angularJS based applications more than others?


I'm building a web application (obviously) using angularJS and I want my app to communicate with a MySQL database. I thought about using php but than I saw some different opinions (google) about the server side language I should choose to bind best with angular app. Some said that ruby is the best most robust server side language. Others said that it will be best to choose node.js cause in that case I get both my client and server written in the same language. Last ones said that to go for php as it's simply the most comfortable one. Before I'm approaching to learn a new language (i do have basic understanding of php and some of its built in functions including database related ones) I wanted to ask whats the common choice that web developers choose and if this is a "sort of unambiguous" question. Any opinion is highly appreciated.


Solution

  • I think the only one that can best answer your question is yourself. You see, there in not a "best" server side solution to work with AngularJS. I think the most important part would be to choose the one you are most confortable with, or one you are willing to learn since you believe it can work for you in the future.

    That said, you could maybe take some other things into account to decide. For example, if you are planning to create a RESTful Api on the backend, using MySQL as the Database engine, you could use angular's $resource service to easily communicate with it. Here is a link to it's documentation:

    $resource

    In this case, the backend could be run on top of anything. Node has some great libraries to create custom REST Api's, and rails is another good option too. Here are a couple of links that may interest you:

    HAPI - A web and services application framework for NodeJS

    Fast, unopinionated, minimalist web framework for Node.js

    Building a RESTful API in a Rails Application

    The first two are NodeJS frameworks and the third is a very good tutorial on how to build a restfull API.

    With regards to your comments about which server is most robust or faster, is not really clear. And there in no single framework or language that best exploits AngularJS functionalities.

    Just stick to what your gut says and you should be fine.

    Hope this helps!