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.
मित्रांनो, हा टेबल चार स्टॅक्स एकाच नजरेत दाखवतो. इंटरव्ह्यूआधी एकदा वाचा – आणि लक्षात ठेवा, सगळ्यांसाठी सिक्युरिटी ग्रुपमध्ये फक्त 22, 80 आणि 443.
दोस्तों, ये टेबल चारों स्टैक्स एक ही नज़र में दिखाता है. इंटरव्यू से पहले एक बार पढ़ लो – और याद रखो, सबके लिए सिक्योरिटी ग्रुप में सिर्फ़ 22, 80 और 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.
Ravindra Bagale's Tip – मराठी
Stack निवडताना मी students ना एकच प्रश्न विचारतो: team ला कोणती language येते? PHP येत असेल तर LAMP किंवा LEMP, JavaScript येत असेल तर MEAN किंवा MERN. Ports आणि security group सगळ्यांसाठी सारखेच – फरक फक्त आतल्या tools चा.
Ravindra Bagale's Tip – हिंदी
Stack चुनते समय मैं students से एक ही सवाल पूछता हूँ: team को कौन सी language आती है? PHP आती है तो LAMP या LEMP, JavaScript आती है तो MEAN या MERN. Ports और security group सबके लिए एक जैसे – फ़र्क सिर्फ़ अंदर के tools का.
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
| Stack | Front | App | Data | Typical use |
|---|---|---|---|---|
| LAMP | Apache | PHP (mod_php or FPM) | MySQL | WordPress, many small business sites |
| LEMP | nginx | PHP-FPM | MySQL | Laravel apps, busy WordPress |
| MEAN | nginx | Node.js + Express, Angular | MongoDB | Single-page dashboards |
| MERN | nginx | Node.js + Express, React | MongoDB | Startups, SaaS front ends |
| Spring + React | nginx / ALB | Java Spring Boot (embedded Tomcat) | PostgreSQL / MySQL | Banking, enterprise apps |
| .NET | nginx / IIS / ALB | ASP.NET Core (Kestrel), Angular | SQL Server / PostgreSQL | Enterprise portals |
| Django | nginx | Python + Gunicorn | PostgreSQL | Content and data-heavy apps |
| Rails | nginx | Ruby + Puma | PostgreSQL | Startups |
| Go API | nginx / ALB | Go binary | PostgreSQL + Redis | High-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.