Node, Go, Java, C# or Elixir?
You want to make a Web application and you wonder what platform is best if one day you will have a large number of users...
We often see the post of a developer explaining why he abandoned the language X for Y and rewrote his web application, and the reverse is also true, another rewrites its application from Y to X. This rarely happens to local or mobile applications. The choice of a development language is more crucial on the web, which is why it seemed useful to perform this study on the different platforms in vogue, with the advantages and disadvantages of each, and for what kind of application they are suitable. This could help to avoid rewriting the code after several months of development ...
What type of application?
- This is the platform of creativity. The dynamism of JavaScript offers unique capabilities for creating new features.
- An application that responds to events is implemented more easily in JavaScript (simulation, robotics).
- Real-time applications benefit from asynchronous mode. For example, a chat site.
- Applications with many input-outputs.
- Not suitable for a site whose users use to much the server's processor, such as processing of images or sound.
Avantages
- Most programmers know the JavaScript language, project start is immediate and simplified because the interface language is the same. This avoids to think differently on the backend and frontend.
- Many languages are compiled into JavaScript and can run on Node, if you have another favorite language, you may use it.
- Ease of NPM to include modules, that other platforms such as ROR could envy.
- Using a framework like Express, we can develop and implement an online application in minutes ...
- You can write BD requests in JavaScript rather than SQL (it's easier) without being disoriented.
- Likewise for JSON data that is common on the Web.
- We take advantage of multi-core with the Cluster module.
Disadvantages
- The environment is constantly changing, a popular framework today will be replaced by another in a few months ... But nothing prevents you from continuing with the same tools.
- The events-oriented mode with a unique processing loop may be a problem for a website because when customers abuse, the whole site is idle. However, you can control these excess charge with specialized tools.
- Spaghetti code with callbacks - They have nothing mandatory, it is easy to write code differently with named functions, it is a matter of style. The problem remains, however, when using third-party code.
- The behavior on a large load could be difficult to assess.
What well-known sites use Node.js?
- MySpace with Express. This allows it to easily create new functions.
- Yahoo uses it wherever it suits alongside other languages.
- Paypal replaced Java by Node.js, with a better result.
- Ancestry.com est built entirely on Node (100M req/day).
- Netflix.com. Its blog explains how it resolved heavy load issues.
- Groupon migrated its sites from Ruby, Java and PHP to a unique Node.js solution, plus the Gofer API and Node cached. (Source)
- Twitter migrated its mobile activity to Node + Express + React PWA (Progressive Web App).
- Uber manages the availability of drivers and customers with Node.
What type of application?
- For conventional web services or applications.
- When you want to recruit developers without experience.
- When productivity is the prime factor.
- When the source code is very big and must be changed often.
- Seems particularly appropriate for cloud software, or related to it.
Avantages
- A comprehensive set of tools for effective development.
- Simple language favoring collaborative work and code maintenance.
- A very fast compilation.
- Uses little memory.
- Concurrency is built into the language.
- No need to install a big runtime such as Java, only the binary program.
- The website of the language is very convenient. Its accessibility is unrelated to that of others.
Disadvantages
- The language is rather limited, it is expected to type more code than others. This makes it boring.
- Libraries can miss for your application.
What well-known sites use it?
- Google is the first user.
- Docker.
What type of application?
- All the traditional applications that use databases and communicate with many customers.
- When we want to be sure to have all necessary libraries and server-side frameworks such as those of Apache.
- To be more likely to find experienced developers.
Avantages
- Many open source tools have been developed in Java to run large websites, mainly by the Apache Foundation.
- Debugging and profiling tools even on a cluster of machines.
- Huge library.
- Multithreading makes independent sessions and avoid blocking one by the other. This uses more resources, however.
- Can operate in distributed mode (like Erlang).
- Can operate in asynchronous mode (like Node) with Vert.x. module.
Disadvantages
- This is undoubtedly the platform that requires most hardware resources. You can not install Java on any server.
- It is more difficult to learn Scala than other languages. As for Java, it is very verbose and it is more difficult to go from idea to realization.
What well-known sites use it?
- Twitter uses Scala.
- All sites that use Apache Hadoop, including Facebook, also use Java.
- Java is a widely used web backend, using the Apache tools or not.
What type of application?
- The site of the language recommends it for e-commerce, banking, telecommunications, messaging, and similar applications.
- Suitable for conventional web applications, but be sure to have many users.
- When many users are simultaneously connected and interact indirectly (on same objects).
Avantages
- Can handle a large number of users.
- Also specialized for distributed and fault tolerance systems. Fault tolerance is one of its basic principles.
- Garbage collector without pause on applications that last.
- Mnesia integrated database suitable for complex searches (not documents).
Disadvantages
- Less libraries than others.
- The Erlang language is slow - but the platform as a whole compensates this defect.
- The community is reduced. This translates into a lack of documentation and support.
What well-known sites use it?
- Whatsapp is written in Erlang. The number of users approaches one billion.
What type of application?
- The platform was originally made for Windows but is now portable to run on the cloud with any OS. It is therefore appropriate to online applications of all types running on the cloud.
- Native .NET applications compiles AOT, so are suitable for mobile applications.
Avantages
- The Roslyn compiler and runtime environment CoreCLR are open source.
- Interpreted by JIT or compiled AOT.
- Visual Studio provides a complete development environment and can produce applications for Windows, Linux or Mac on the same computer.
- We can install different versions of .NET on the same server, in containers, and so are able to test a new version before replacing the previous one.
Disadvantages
- For application already developed for the .NET Framework, migration to .NET Core is not immediate, part of the code should be rewritten.
- Many libraries are missing and developement tools are not at .NET level (in 2016).
What well-known sites use it?
- StackOverflow is based on .NET and Dapper.
What type of application?
- Few startups use PHP to run a Web application. Rather, it is the language the most used for small sites. But the typed version of the language, Hack, could support a wide audience and also PHP 7.
- It's the most economical for the hosting and it is therefore appropriate for a site with limited goals.
Avantages
- PHP is easy to deploy with an Apache server.
- It is available on all hostings.
- Its library is almost universal and frameworks like Laravel provide ready-to-use application environments.
- It is designed to interface with databases.
- It does not need you to build template pages, the language is the template.
Disadvantages
- Derived from the old command line tools, this language is rustic and incoherent.
- PHP was very insecure, until version 7, which now requires the use of mysqli instead of mysql.
What well-known sites use it?
- Facebook was built in PHP but now uses Hack, a derivative language. Moreover Facebook also uses many tools to manage the heavy load.
- Wikipedia is based on PHP, but it's less an application than a page server. The same for Wordpress.com.
- Dailymotion has migrated its 10 yers old PHP code to PHP 7, after a try of HHVM. PHP 7 offers the same performance and easier migration.
- Tumblr migrated from PHP 5 to PHP 7 in 2015. They shared their experience about the improvements.
- The implementation of the En marche website is entirely detailed in an article and the source code is available on GitHub (Uses Symfony, React).
Conclusion
You may see that the larger sites can use one of the five solutions without problems apparently. Sometimes they give up a platform for the benefit of another, and not always in favor of the same. This shows that the best platform mainly depends on the application that you want to build.
Note: Ruby on Rails is described in the page about Ruby, There are other platforms that I have not mentioned because of their drawbacks: scalability, slowness, hard to debug, unsafe..