Comparing Server Technologies – NODE.JS VS. Java Vs. PHP
Comparing Server Technologies – NODE.JS VS. Java Vs. PHP
Being a software company, clients approach us on a daily basis asking if we can develop a new application or website for them.
When developing an application, it is important to understand that in most cases a system must also have a working server. The server is needed to perform several functions, including user management, handling complex business logic, managing the content displayed on the app, money transactions and more.
When you need to develop a server, the question of what technology to use often comes up.
In this article I will talk about these technologies: ASP.NET, NODE.JS, PHP and JAVA EE. Other technologies do exist; however, I have chosen to refer only to those technologies which I have significant working knowledge of.
The purpose of this article is to provide the beginner entrepreneur with a basis from which he or she can compare the technologies mentioned above. I will not attempt to answer the question of which technology is better, as there is no easy answer to that. Instead, I wish to provide the
reader with a set of guidelines that can help answer the following question: "what server technology best suits my needs?"
Meaning that it's important to take into account that while one technology may suit one system, a different technology may be needed for a system with a different set of requirements. In addition, when specifications are given for the development of a certain system, a number of solutions could apply, with no real advantage of one technology over another.
After stating these reservations, I can attempt to compare these server technologies by dividing the comparison process into categories:
Question: when specifications are provided for a certain system, what technology will require the least amount of time for development?
Answer: JAVA and .NET have the advantage in this category because they come with many automatic tools “straight out of the box” (along with the development environment), or add-ons that are easily assembled in the development environment. For .NET, the only effective development environment is Visual Studio. For JAVA, the leading development environment today is NetBeans (although there are many other development environments, such as Eclipse etc.). These two development environments contain a large set of tools that can help with coding automation.
The significance of these tools in the development process is that when we want to program coding elements that can perform basic functions quickly, these tools allow us to generate basic code with only a few clicks. This allows programmers with only a basic knowledge to easily develop the basis for their code. In other words: for systems that require a relatively simple server side, the development process can be significantly reduced by using these tools.
However, in many cases, the server side contains complicated business logic that is system specific. In these cases the use of automated
tools for generating basic code is insignificant to the development process because the code must contain complex logic which cannot be generated by automation. Here, the individual programmer’s coding skills and his or her command of the set of technologies at their disposal is brought to test, and thus no one technology is better than the other.
In conclusion: in some cases, automation tools provided by development environments such as Java and .NET may enhance the pace of development. However, for most systems,
what mostly affects the development process is how trained the development team is with the technologies used and their ability to provide quick and effective solutions for the system’s requirements.
Ease of performing changes to code and expanding it
An important challenge that every system faces in the long run is the ability to easily add system capabilities, and the ability to easily change existing logic.
A significant difference between JAVA and .NET technologies and scripting languages such as NODE.JS and PHP, is in that the first two are generally more “rigid”. These languages are object-oriented programming based, and their coding principles include main concepts from OOP programming principles, such as inheritance, interfaces and type safety.
So what is the significance of these fundamental differences regarding the ability to perform changes and to expand code easily?
The answer to this question is complicated. But to make things simple, I will provide a general rule of thumb from my personal experience: in many cases, for limited capacity systems, development processes that involve a relatively small development team (say up to 3 programmers working on the server side), I will prefer to use technologies such as NODE.JS and PHP. This is because the need to satisfy the programming principles of object-oriented programming based languages may lengthen the timeline needed to make system changes.
On the other hand, if the server side of a certain system is particularly complex and requires more than one team working on the system’s coding components, then the principles of a language such as C# (the language on which most NET systems are based) and JAVA dictates modular coding, a much tighter definition of the system’s architecture and the way system components interact with each other. This way one or more teams can simultaneously work on different system components while providing a clearer definition of the services they provide.
In conclusion: the ability to make changes and expansions in an existing system depends firstly on the system’s architecture. The set of principles that languages such as JAVA and C# are based on provides the basis for expansions, and enables teams to work simultaneously on the system’s code. But it’s important to remember that using these principles dictates an additional coding overhead that isn’t required for systems developed by a small to medium development team.
Another point entrepreneurs must consider when developing a new system
is the financial aspect. This is a major consideration for many entrepreneurs (especially during the initial development stage).
The costs involved in the development and maintenance process of the server side of a specific system include:
Acquiring a licence for the development environment. For .NET based systems – Microsoft is now providing a free community edition of Visual Studio which will most likely satisfy the average programmer needs, and so there is no need to purchase the Enterprise edition which is a lot more costly. For Java based systems – NetBeans is an excellent free development environment. For NODEJS and PHP – there are several free development environments, although my personal preferences are Webstorm, and Jetbrains’ PHPstorm, which require a subscription fee (however these fees are relatively low).
2. The server’s operating system – here there is a significant disadvantage to .NET based systems. Although there are solutions that enable running a NET based system on LINUX servers (MONO for example), the natural environment for .NET is Windows. The cost of acquiring licenses for Windows varies according to the type of server purchased, and may be a significant factor.
There are other factors that may add to the costs on the server side (such as third party software components, etc.). The cost of such components may vary depending on the type of technology chosen. Generally speaking, for NODE or PHP based servers there are a number of free third party solutions, since these languages are naturally intended for the Open Source programmers community.
In conclusion: if the development budget is limited, servers based on open source technology (like PHP and NODE.JS) are preferred over .NET servers.
Handling high server loads and a large number of users
This element is crucial for most entrepreneurs. Assuming that a system will prove successful and gain wide use, it is important to ensure that an increase in server load does not cause a delay in server response or other problems. The web is filled with articles comparing the performance of different server technologies, but these articles are mostly based of prior assumptions and slanted perceptions of the system requirements. In my view, it is entirely possible that a certain technology could excel on one set of tests, while for a different set of tests the results will be completely different. In general I will say that all the server
technologies mentioned in this article were basically designed to support multi user environments that can handle system loads. In my experience, a key issue that affects a system’s performance capabilities is a correct design of the system. This can be achieved by writing effective code and avoiding coding that causes bottlenecks when the system is loaded.
Another major factor for creating a system that supports high loads is ensuring the correct configuration of the server farm, and putting in place mechanisms that can handle common problems encountered in a scenario involving high loads. These configurations and mechanisms don't necessarily have to do with the chosen server technology, and more relate to the environment it is placed in and the services that this environment provides. For example, if using AWS (Amazon's Web Services) for hosting, there is a set of tools and mechanisms designed to handle server loads and handle different kind of errors.
In conclusion: all of the server technologies I mentioned in this article are ”mature” enough to withstand challenges of a high scale multiuser environment. The key component that affects system performance is the correct coding and a good understanding of resource management principles while writing code. Other key elements are the system configuration, the environment in which the server is placed and the tools it provides.