MEAN/MERN/LAMP/SST
Tags: webdev, programming, opensource
Published: 2023-10-26 12:35:00

##Tech Stacks

<p>Tech stacks can be a monster when learning to program web applications. There are so many languages and technologies that can leave the developer feeling overwhelmed. I have personally felt that way and I'm not a seasoned professional yet. However, as part of the trade, all web developers should at least be aware of what a tech stack is and these stacks that I'll be discussing in this blog.</p>

<p>For starters, we should know that tech stacks, or software stacks, are set of layered tools, libraries, programming languages, and technologies that are bundled and used to build, manage, and run applications. They consist of software components that support the application in various ways from visual model, database, networking, to security.</p>

<p>In this blog, I'll be diving into four widely used, common tech stacks that provide their own successful environments that can benefit web developers. We'll be diving into MEAN, MERN, LAMP, and SST, their components, and how they might be used. To start us off, let's get MEAN.</p>

---

##MEAN vs MERN
<p>The MEAN tech stack is defined by its four components: MongoDB, Express.js, Angular.js, and Node.js. However, at its core, MEAN is classified as a JavaScript-based framework in web development. Its counterpart MERN (also JavaScript based) simply replaces Angular with React meaning they both contain different front-end frameworks while operating the same technologies via server-side and back-end. While both tech stacks' components are written in JavaScipt from top to bottom, there are a few differences between the two. As a result, these differences are integral in helping a developer make a decision on which one to use. Let's explore both stacks and their front-end differences.</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9w6k3q3kvnis6j7akjx.png)


<p>Starting at the top tier of the MEAN architecture, Angular allows the developer to extend HTML tags with metadata, which in turn helps create dynamic/interactive web applications. In this stack, Angular interacts directly with Express.js since Express acts as the project's internet-facing web server. Express is simply another framework for Node.js that utilizes models for URL routing, handling HTTP requests/responses (GET/POST) from the Angular front-end, which contributes to more dynamic client experiences. By utilizing this line of communication between Angular and Express, the requests from Angular can connect to the Express functions that drive the application. As a result, these functions can use MongoDB's Node.js components with either callback functions or promises. These callbacks/promises are how developers access and update the data stored in the MongoDB database.</p>


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hw4stn2dk6ozk2q9n4qr.png)



<p>Similar to MEAN, the MERN stack implements a similar process, but in the scope of React.js which is newer among JavaScript front-end frameworks. The difference in using React is that developers are given simple components that can be connected to data on the back-end server and render them as HTML. The React components are designed to handle stateful, data-driven interfaces while requiring minimal code. It is important to note that the use of these components require the .jsx file extension that needs to be bundled. This step is crucial as it reduces the number of HTTP requests the browser needs to make, minifies the code and eliminates unnecessary characters to make the files smaller.</p>

<p>When it comes to choosing between the two stacks, developers should keep in mind their experiences with previous frameworks that relate to the front-end component of each stack. Developers with experience in jQuery find that MEAN is more compatible due to shared syntax conventions. React, as stated earlier, is a younger framework that is more updated that Angular and might be more appealing to younger developers. That being said, it's important to have knowledge and experience in both frameworks in case a project is built with either one.</p>

<p>For use cases, both stacks are designed to work well in handling JSON and JavaScript making the integration between components of each stack more intuitive and straight forward. However, depending on the size of the project, MEAN is often preferred for larger projects while MERN is more commonly used in smaller applications. Now that we've dived into JavaScript/JSON heavy stacks. Let's take a look at an alternative choice for tech stacks, LAMP.</p>
---

##LAMP



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1jdldu7w5pyiq6iautki.png)





<p>Shifting gears from the MEAN/MERN components, LAMP is a stack that bundles Linux, Apache web server, MySQL database and the PHP programming language. It's common to see web developers using this stack for reasons such as lower costs, efficient development speed, consistent maintenance, and flexibility in the architecture. Unlike the previous stacks, LAMP is used for either back-end or server-side development, meaning the application runs in a hidden environment from users. Such applications consist of data processing software, database components, business logic, and API for communicating with other applications.</p>

<p>The top layer of the architecture starts with Linux, an open-source operating system used to manage a system's hardware and resources such as: CPU, memory, and storage. This OS (operating system) exists between application and hardware making connections between the rest of the architecture, thus solidifying its role in supporting the upper layers of LAMP. The Apache web server acts as the second layer module that stores website file and exchanges information with a browser using HTTP. This exchange tends to follow the processes of receiving the request, processing that request to find the requested page file, and sending that information back to the browser.</p>

<p>The third layer of LAMP utilizes the relational database MySQL that stores data in a structured tabular format as opposed to MongoDB in the MEAN/MERN stacks that rely heavily on JSON data and the JavaScript language. MySQL's more rigid structure contributes to the stability of the LAMP stack since LAMP's design is focused on building out reliable back-ends. The last layer, PHP (PHP: Hypertext Preprocessor) is primarily used to determine the behavior of certain components when a webpage is loaded. In this fashion, developers can embed PHP in HTML to present real-time/updated information on websites, which allows the web server, database, and operating system to effectively process requests from browsers. A couple alternatives that can be used to replace the default PHP are Perl and Python.</p>

---

##SST

<p>What about if a developer wanted to deploy a serverless application, and what would that look like?</p>

<p>This can be done via the SST (Serverless Stack) which is also open-source like the previous stacks. It is primarily used to deploy serverless applications on Amazon Web Services (AWS). The stack's design is focused on the flexible, easily-handled support of multiple programming languages and frameworks that include: Node.js, Python, Java, and React. Additionally, SST automatically provisions and configures the necessary AWS resources based on the current application's requirements, ultimately saving time and reducing potential errors. Be aware that if you use this technology, AWS credentials will be required to run and deploy apps created through this stack.</p>

<p>The advantages of using this type of stack can provide greater scalability, flexibility, and quicker time to release, all at a reduced cost. Developers using serverless have less concern over purchasing, provisioning, and managing back-end servers. As a result, developers are able to create and expand their applications without the constraints of server capacity.</p>

<p>When considering to use the Serverless stack, it is crucial to keep in mind the build that is the current focus. Generally if a small number of functions is being hosted, then there should be relatively little to no problems, more complex applications could work but the structure would need to be considered with care. Small pieces here is key as well as using the supported languages of SST. Another step away from using JavaScript driven components can lead developers down this route, and keep in mind this is a product of Amazon Web Services and shouldn't be used elsewhere for consistency's sake.</p>

---

##Closing Remarks

It goes without saying the decisions required for choosing the appropriate tech stack carries weight on a developer's mind. From front-end to back-end considerations, the tech stack chosen best reflects the developer's preferences and experiences. Language driven or cost driven, each of of these stacks provides crucial tools for all developers to get their applications deployed, just give it some thought and determine which environment best suits you.

---

####Resources

- https://en.wikipedia.org/wiki/MEAN_(solution_stack)

- https://www.mongodb.com/mean-stack

- https://www.mongodb.com/mern-stack

- https://www.knowledgehut.com/blog/web-development/mern-stack-vs-mean-stack

- https://aws.amazon.com/what-is/lamp-stack

- https://blog.logrocket.com/build-full-stack-serverless-app-sst

- https://en.wikipedia.org/wiki/Serverless_Framework