Once you have your product idea ready, one of the most important questions that you face is: What technology stack should I use for my product?
Choosing the right technology stack for your product is very important and equally difficult in this age when you see people advocating the benefits of different technologies over others. This dilemma can be eased a lot if you have some basic insights and true information on the matter. In most of the cases, contradiction is between some mature technology stack and a young newcomer with a lot of promises and buzzwords everyone is talking about. In this discussion we are comparing a long term leader LAMP Stack and a highly promising and modern MEAN stack but a lot of this applies to others as well. Understanding this can help you make an informed decision choosing the technology stack for your next good product.
Here we are discussing about web applications. So, first we must understand how web applications work and what are the major stakeholders (in tech context). In general, a web application can be divided into 4 parts. The first two of these points apply to the Backend and API development as well.
LAMP stack stands for Linux Apache MySQL and php/pearl/python. On the other side MEAN means MongoDB, Express.js, Angular and Node.js. Let’s discuss all of these 4 parts of a web application one by one with respect to LAMP stack and MEAN stack.
The server scripting part of LAMP vs MEAN are php/pearl/python vs node.js. Here we’ll discuss php vs node.js for easier understanding.
PHP is an open source server side scripting language designed specifically for web application development in 1994. It has got a lot of love from developers and businesses alike for a long duration. According to different surveys around 80% of websites are developed with php. Through its initial phase, php had some bad reputation about security which was more because of bad programming practices followed by some programmers than because of its own features. But later on it has improved a lot and gained a good reputation among the community. Because of very vast usage and so long period of dominating the web development domain, php has a lot of libraries, frameworks, packages, resources and a huge community for help.
Being asynchronous in nature and non-blocking I/O model, node js is ideal for applications where you need real time communication between browser and server. The example use cases might be chat rooms, stock trading, live streaming etc.
Hence it is clear that both php and node.js have their own advantages and it depends on your application which technology is better suited for your application/product. When is doubt your developer may better understand which technology is better fit for your requirements.
In LAMP stack mySQL (or mariadb, postgre-sql etc) is used for database management while the counterpart in MEAN stack is MongoDB. MySQL is a Relational Database Management System while MogoDB is a noSQL. Both are completely different by nature and have their own pros and cons. MongoDB (or NoSQL databases in general) store the data in json like documents that can vary in structure while MySQL stores the data in tables with defined structure. Though, later versions of mysql support JSON data type where json documents can be stored but if your entire database is unstructured, NoSQL databases would be a preferred choice. Another famous advantage of MogoDB is its capability to handle huge data with horizontal scaling which normally influences a lot of decisions. But you should mind the amount of data which mysql can easily handle. We at techosquare solutions have developed and are maintaining some of the applications with upto 5GB of database with aws t2.small instances (having only 2GB of RAM) and it never lags or cause any problems even generating very complex reports. And that is not the limit. Several developers claim to be using upto 10TB of databases with mysql easily. So, don’t be impressed with the claims (though true) that mongodb can handle comparatively larger databases. More important is what type of data will your application have and what operations on that data will it be performing. There are several cases where developers chose mongodb for the sake of faster operations on huge data but later on regretted when they found it more difficult to do complex transactions and faced data integrity issues.
So, if you have a good size database being managed with RDBMS like mySQL and it lags in performance, don't rush to shift to noSQL based databases. Get in touch with some expert database managers and check the reason.
An experienced and mature developer can suggest you better which database management system is better suited for your application based on your application needs.
This part is done with html and css which is common with both LAMP and MEAN stacks being discussed here. In case of backend development as APIs or Microservices, the output is normally formatted as JSON or XML. So, there is not much to discuss on this topic.
There are more aspects to be considered while picking the technology stack for your product/application. For example availability of hosting services, availability of developers etc. PHP being a leader in web domain for so long, you get hosting and developers very easily for LAMP stack as compared to MEAN stack.
Both, LAMP stack and MEAN stack have their own advantages and which one you should choose for your application depends on the requirements. So consult with a good experienced development company to make the right decision.