Ravindra BagaleCourses & study guides मराठी Track your progress

Chapter 12: Technology Stacks — LAMP, LEMP, MEAN, MERN

12.9 Stack comparison summary

Friends, this table shows the four stacks at a single glance. Read it once before an interview – and remember, for all of them the security group needs only 22, 80 and 443.

Point LAMP LEMP MEAN MERN
Web server Apache Nginx Nginx (reverse proxy) Nginx (reverse proxy)
Backend PHP PHP-FPM Node.js + Express Node.js + Express
Frontend Server-rendered PHP/HTML Server-rendered PHP/HTML Angular SPA (TypeScript) React SPA (JSX)
Database MySQL/MariaDB MySQL/MariaDB MongoDB MongoDB
Process manager systemd (httpd/apache2) systemd (php-fpm) pm2 / systemd pm2 / systemd
Ports used internally 80, 3306 80, FPM socket, 3306 80, 5000, 27017 80, 5000, 27017
Security group opens 22, 80, 443 22, 80, 443 22, 80, 443 22, 80, 443

Ravindra Bagale's Tip

When choosing a stack I ask students just one question: which language does the team know? If PHP, then LAMP or LEMP; if JavaScript, then MEAN or MERN. Ports and security group are the same for all – only the tools inside differ.

Lab

Chala, table madhun LEMP aani MERN che teen farak liha: backend, database aani internal ports. Mag tumchya EC2 var sudo ss -tlnp chalva aani sadhya kontya ports var koni aikto te table shi julva.

Beyond the four: other stacks you will meet

StackFrontAppDataTypical use
LAMPApachePHP (mod_php or FPM)MySQLWordPress, many small business sites
LEMPnginxPHP-FPMMySQLLaravel apps, busy WordPress
MEANnginxNode.js + Express, AngularMongoDBSingle-page dashboards
MERNnginxNode.js + Express, ReactMongoDBStartups, SaaS front ends
Spring + Reactnginx / ALBJava Spring Boot (embedded Tomcat)PostgreSQL / MySQLBanking, enterprise apps
.NETnginx / IIS / ALBASP.NET Core (Kestrel), AngularSQL Server / PostgreSQLEnterprise portals
DjangonginxPython + GunicornPostgreSQLContent and data-heavy apps
RailsnginxRuby + PumaPostgreSQLStartups
Go APInginx / ALBGo binaryPostgreSQL + RedisHigh-throughput APIs

Internal ports per stack (keep them private)

The security group still opens only 22 (restricted), 80 and 443. These ports stay inside the server or the VPC.

LAMP / LEMP

MySQL 3306, PHP-FPM socket or 9000.

MEAN / MERN

Node 3000 or 5000, MongoDB 27017.

Spring Boot

8080, PostgreSQL 5432.

ASP.NET Core

5000 or 8080, SQL Server 1433.

Django / Rails

8000 / 3000, PostgreSQL 5432.

Go

8080, PostgreSQL 5432, Redis 6379.

Real examples

Indian company (sample): an Infosys banking client team runs Spring Boot + Angular + PostgreSQL on AWS, with an Application Load Balancer in front. Global: WordPress (LAMP or LEMP) runs a very large share of all websites. Everyday: a thali. Different dishes, same plate. The stack is the plate layout.

Key terms

  • Stack: A set of technologies used together.
  • SPA: Single-page app (React, Angular), built to static files.
  • REST API: An HTTP interface returning JSON.
  • try_files: The nginx rule that lets SPA routes work on refresh.
  • bindIp: The MongoDB setting for which addresses it listens on.
  • ODM / ORM: Libraries that map objects to documents or tables, such as Mongoose, Hibernate, EF Core and Django ORM.

Mini case study

Suppose we are a junior cloud engineer at a Bengaluru e-commerce startup (sample data). The team runs a PHP admin, a Node.js storefront API and a Python report job on two EC2 instances. Using this chapter, you write a one-page runbook: which service listens where, how to test and reload each one, which logs to read, and which ports are public (only 80 and 443, plus 22 from the office IP). New team members can then fix most problems on their own.

Recap

  • Many stacks, one pattern.
  • Only 80/443 (and restricted 22) are public. Everything else is private.