🏗️ Terraform Series Part 9: 3-Tier Architecture (ALB + EC2 + Database)

📘 Terraform Series — Part 9

Part 8 မှာ AWS VPC ကို Terraform နဲ့ build လုပ်ခဲ့ပြီးပါပြီ။

အခုတော့ —

👉 Real production architecture ကို build လုပ်မယ် 🔥


🎯 ဒီ Lesson ရဲ့ ရည်ရွယ်ချက်

👉 3-Tier architecture နားလည်ရန် 👉 AWS service integration ကို သိရန် 👉 Real system design ကို လေ့လာရန်


🏗️ 3-Tier Architecture ဆိုတာဘာလဲ?

System ကို 3 layers ခွဲထားတာပါ —

1. Frontend Layer (ALB)
2. Application Layer (EC2)
3. Database Layer (RDS)

🌐 Architecture Overview

Internet
   ↓
Load Balancer
   ↓
Application Servers
   ↓
Database

🔹 Layer 1: ALB (Load Balancer)

👉 User request ကို receive လုပ်တယ် 👉 EC2 instances တွေဆီ distribute လုပ်တယ်


🔹 Layer 2: EC2 (Application)

👉 Application run လုပ်တဲ့နေရာ 👉 Multiple instances scale လုပ်နိုင်တယ်


🔹 Layer 3: RDS (Database)

👉 Data သိမ်းတဲ့နေရာ 👉 Private network ထဲမှာထားရမယ်


🧠 Why This Architecture?

👉 Performance improve 👉 Scalability increase 👉 Security better


🔧 Terraform Structure

modules/
  vpc/
  alb/
  ec2/
  rds/

👉 Each component ကို module တစ်ခုစီအဖြစ် manage လုပ်ပါ


🔹 Example (Simplified)

ALB

resource "aws_lb" "main" {
  load_balancer_type = "application"
}

EC2

resource "aws_instance" "app" {
  instance_type = "t2.micro"
}

RDS

resource "aws_db_instance" "db" {
  engine = "mysql"
}

🔐 Security Design

👉 ALB → Public 👉 EC2 → Private 👉 DB → Private

👉 Security Groups နဲ့ restrict လုပ်ပါ


🚀 Deployment

terraform apply

🧠 Result

သင် build လုပ်ပြီးနောက် —

✔ Load Balancer ✔ Application servers ✔ Database

ရှိပါပြီ။


💡 DevOps Insight

👉 This is real production architecture

👉 Companies use this pattern everywhere


⚠️ Important

👉 Cost တက်နိုင်ပါတယ် 👉 Testing ပြီးရင် destroy လုပ်ပါ


🎯 ဒီနေ့ သင်လေ့လာခဲ့တာ

✔ 3-tier architecture design ✔ AWS services integration ✔ Terraform system thinking


🚀 နောက်ထပ် ဘာလာမလဲ?

👉 Terraform + CI/CD (GitHub Actions)


👨‍💻 About

Ahkar မှာ DevOps knowledge မျှဝေနေပါတယ် 🚀

🌐 https://mindgnite.com


📚 Series Flow

Part 8 → VPC Part 9 → 3-Tier Architecture (ဒီ post) Part 10 → CI/CD

👉 Continue learning 🔥


👨‍💻 English Version

“Read full English version on Dev.to → visit Here

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Scroll to Top
0
Would love your thoughts, please comment.x
()
x
Share via
Copy link