Thuta Learning
How the Web Works
ProjectsWeb Developmentbeginner

Project: ဝဘ် Architecture တစ်ခုလုံးကို Design ဆွဲခြင်း

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • Project: ဝဘ် Architecture တစ်ခုလုံးကို Design ဆွဲခြင်း concept ကို နားလည်ရှင်းပြနိုင်ရန်
  • Diagram ကို ဖတ်ပြီး request/data/event ဘယ်လိုစီးဆင်းသလဲ ခြေရာခံနိုင်ရန်
  • ဒီ piece က web architecture တစ်ခုလုံးထဲမှာ ဘယ်လို ဆက်စပ်နေသလဲ ရှင်းပြနိုင်ရန်

နားလည်ထားရမယ့် အချက်

Capstone project က diagram အသစ်ကို အလွတ်ကျက်ခိုင်းတာမဟုတ်ဘဲ Advanced chapter ရဲ့ SaaS/real-time/AI/e-commerce architecture lesson တွေမှာ သုံးခဲ့တဲ့ building block တွေကိုပဲ requirement list တစ်ခုကနေ ကိုယ်တိုင် assemble ဆွဲခိုင်းပါတယ်။

စစ်ဆေးနေတဲ့ skill က composition ဖြစ်ပါတယ် — component တစ်ခုချင်းစီဟာ requirement အစစ်အမှန် တောင်းဆိုလို့ ပေါ်လာရမှာဖြစ်ပြီး ကြုံဖူးတဲ့ diagram ကို pattern-match လုပ်တာ မဟုတ်ပါဘူး။

  • Authentication လိုအပ်ရင် -> auth service
  • Data ကို persistent သိမ်းစရာလိုရင် -> database
  • File upload လိုရင် -> object storage (database မဟုတ်ပါ)
  • Notifications ပို့ရရင် -> notification service
  • Realtime feature ရှိရင် -> persistent connection (WebSocket/push channel)

အများဆုံးတွေ့ရတဲ့ အမှား

Requirement ဘယ်ဟာမှ မတောင်းဆိုတဲ့ service ကို ရှေ့က diagram မှာ တွေ့ခဲ့လို့ပဲ ထည့်လိုက်ခြင်း၊ ဒါမှမဟုတ် 'frontend က backend ကို ခေါ်တယ်' နဲ့ ရပ်ပြီး backend-adjacent service ဘာတွေ တကယ်လိုအပ်လဲ မသတ်မှတ်ခြင်း

Client/server mental model က နောက်ကွယ်မှာ အမြဲရှိနေပါတယ် — 'backend' ဆိုတာ box တစ်ခုတည်း မဟုတ်ဘဲ requirement တွေက တကယ်တောင်းဆိုတဲ့ specialized service တွေ ပါဝင်တဲ့ backend တစ်ခုပါ။

text
ASSEMBLED WEB ARCHITECTURE FROM REQUIREMENTS
--------------------------------------------
FULL ARCHITECTURE: AUTH + DASHBOARD + DATABASE + UPLOAD + NOTIFY
--------------------------------------------------------------------
[User]
   |
   v
[Browser] <---- static assets ----> [CDN]
   |
   | HTTPS request (API calls)
   v
[Frontend]  (dashboard UI, served via CDN)
   |
   v
[Backend / API]
   |
   +----------------+----------------+------------------+
   |                |                |                  |
   v                v                v                  v
[Database]   [Auth service]   [Object storage]   [Notification
                                                    service]

လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်

ရုပ်ပုံတစ်ခုလုံးကို တစ်ခါတည်း ဆွဲမယ့်အစား requirement list ကနေ top-down အလုပ်လုပ်ပါ။

Requirement တွေကို ဝါကျအဖြစ် ရေးပါ

Login, dashboard, persistent data, file upload, backend API, notifications — ခြောက်ခုကို ရှင်းရှင်းရေးချပါ။

Requirement တစ်ခုချင်းစီကို component တစ်ခုနဲ့ map လုပ်ပါ

Authentication -> auth service, data storage -> database, file upload -> object storage, notifications -> notification service။

Frontend/backend base ကို အတည်ပြုပါ

Dashboard နဲ့ API က component အသစ်မထည့်ပါ — course ရဲ့ project တိုင်းရဲ့ base ဖြစ်တဲ့ frontend/backend ကိုသာ အတည်ပြုပေးပါတယ်။

Diagram ကို assemble လုပ်ပါ

User -> Browser -> CDN -> Frontend -> Backend ကို ဆွဲပြီး backend ကနေ map လုပ်ထားတဲ့ service တွေဆီ ကွဲထွက်စေပါ။

Code ကို run ပြီး နှိုင်းယှဉ်ပါ

designArchitecture() ကို requirement object နှစ်ခုနဲ့ run ကြည့်ပြီး လက်ရေးဆွဲထားတဲ့ diagram နဲ့ တိုက်ဆိုင်ကြည့်ပါ။

Flag တစ်ခုကို ပြောင်းပြီး (file upload ဖျက်၊ realtime ထည့်) ပြန် run ကြည့်ပါ — component တစ်ခုတည်း ပေါ်လာ/ပျောက်သွားတာကို တွေ့ရင် mapping က one-to-one ဖြစ်နေကြောင်း သက်သေပြပါတယ်။

အတူတူ စမ်းရေးကြည့်မယ်

javascript
function designArchitecture(requirements) {
  const {
    needsAuth = false,
    needsDatabase = false,
    needsFileUpload = false,
    needsNotifications = false,
    needsRealtime = false,
  } = requirements;

  // Every project in this course starts from the same base: a client,
  // a CDN for static assets, a frontend, and a backend that talks to them.
  const components = ['Browser (client)', 'CDN (static assets)', 'Frontend', 'Backend / API'];

  if (needsAuth) components.push('Auth service / identity provider');
  if (needsDatabase) components.push('Database');
  if (needsFileUpload) components.push('Object storage (file uploads)');
  if (needsNotifications) components.push('Notification service');
  if (needsRealtime) components.push('Realtime channel (WebSocket / push)');

  return components;
}

const dashboardApp = designArchitecture({
  needsAuth: true,
  needsDatabase: true,
  needsFileUpload: true,
  needsNotifications: true,
  needsRealtime: false,
});

console.log('Dashboard app architecture:');
dashboardApp.forEach((c, i) => console.log(`${i + 1}. ${c}`));

const chatApp = designArchitecture({
  needsAuth: true,
  needsDatabase: true,
  needsFileUpload: false,
  needsNotifications: true,
  needsRealtime: true,
});

console.log('');
console.log('Realtime chat app architecture:');
chatApp.forEach((c, i) => console.log(`${i + 1}. ${c}`));
You should see
ဒီ lesson ရဲ့ requirement set (auth+database+upload+notifications) နဲ့ realtime chat requirement set နှစ်ခုအတွက် designArchitecture() ရဲ့ output က:

Dashboard app architecture:
1. Browser (client)
2. CDN (static assets)
3. Frontend
4. Backend / API
5. Auth service / identity provider
6. Database
7. Object storage (file uploads)
8. Notification service

Realtime chat app architecture:
1. Browser (client)
2. CDN (static assets)
3. Frontend
4. Backend / API
5. Auth service / identity provider
6. Database
7. Notification service
8. Realtime channel (WebSocket / push)

၅ မိနစ် စမ်းကြည့်

needsAuth:false, needsDatabase:true, needsFileUpload:false, needsNotifications:false, needsRealtime:true (ဥပမာ anonymous live-poll app) ဆိုတဲ့ requirement set အတွက် architecture ကို design ဆွဲပြီး ထည့်ထားတဲ့/ချန်ထားတဲ့ component တစ်ခုချင်းစီ ဘာကြောင့် မှန်ကန်လဲ ရှင်းပြပါ။

သတိလေးတစ်ချက်

Requirement ဘယ်ဟာမှ တောင်းဆိုမထားတဲ့ architecture component ကို ရှေ့ lesson diagram မှာ တွေ့ဖူးလို့ပဲ ထည့်လိုက်ခြင်း

Storage ကို database နဲ့ ရောထွေးပြီး file upload အားလုံးကို database ထဲထည့်ဖို့ design လုပ်ခြင်း — real system တွေမှာ file တွေက object storage ကို သွားရပါတယ်

System Design Primer (GitHub)How the Web Works

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • Requirement ဘယ်ဟာမှ တောင်းဆိုမထားတဲ့ architecture component ကို ရှေ့ lesson diagram မှာ တွေ့ဖူးလို့ပဲ ထည့်လိုက်ခြင်း
  • Storage ကို database နဲ့ ရောထွေးပြီး file upload အားလုံးကို database ထဲထည့်ဖို့ design လုပ်ခြင်း — real system တွေမှာ file တွေက object storage ကို သွားရပါတယ်
  • ဒီ course က system map တစ်ခုပါ — REST/DNS/Database/Security ကို နက်နက်ရှိုင်းရှိုင်း လေ့လာချင်ရင် API Tutorial, Cloud & Deployment, SQL, Cybersecurity tutorial တွေဆီ ဆက်သွားပါ။

လေ့ကျင့်ခန်း

needsAuth:false, needsDatabase:true, needsFileUpload:false, needsNotifications:false, needsRealtime:true (ဥပမာ anonymous live-poll app) ဆိုတဲ့ requirement set အတွက် architecture ကို design ဆွဲပြီး ထည့်ထားတဲ့/ချန်ထားတဲ့ component တစ်ခုချင်းစီ ဘာကြောင့် မှန်ကန်လဲ ရှင်းပြပါ။

You'll know it worked when: ဒီ lesson ရဲ့ requirement set (auth+database+upload+notifications) နဲ့ realtime chat requirement set နှစ်ခုအတွက် designArchitecture() ရဲ့ output က: Dashboard app architecture: 1. Browser (client) 2. CDN (static assets) 3. Frontend 4. Backend / API 5. Auth service / identity provider 6. Database 7. Object storage (file uploads) 8. Notification service Realtime chat app architecture: 1. Browser (client) 2. CDN (static assets) 3. Frontend 4. Backend / API 5. Auth service / identity provider 6. Database 7. Notification service 8. Realtime channel (WebSocket / push)

Project: ဝဘ် Architecture တစ်ခုလုံးကို Design ဆွဲခြင်း | Thuta Learning