နားလည်ထားရမယ့် အချက်
domain name (example.com) သည် လူဖတ်နိုင်သော လိပ်စာဖြစ်ပြီး subdomain (learn.example.com) သည် ၎င်း၏ အစိတ်အပိုင်းငယ် ဖြစ်သည်။ .com ကဲ့သို့သော အစိတ်အပိုင်းကို TLD ဟုခေါ်သည်။ domain ပိုင်ရုံနှင့် hosting ရှိပြီဟု မဆိုလိုပါ။
registrar သည် domain ကို ဝယ်ယူ၊ စီမံသော ကုမ္ပဏီ ဖြစ်သည်။ registrar, DNS provider နှင့် host သည် သီးခြားကုမ္ပဏီများ ဖြစ်နိုင်သည်ကို သတိပြုပါ။
DNS သည် domain name ကို destination နှင့် ဆက်စပ်ပေးသည် - domain -> DNS -> hosting ဆိုသော mental model ကို မှတ်ထားပါ။ record အမျိုးအစား (A, CNAME) ရှိသော်လည်း administration ကို Cloud & Deployment တွင် လေ့လာနိုင်သည်။
- Static hosting - simple file များအတွက်
- Shared hosting - resource ကို site အများနှင့် မျှဝေသည်
- VPS - virtual server ကိုယ်ပိုင်
- Cloud platform - scalable, managed infrastructure
- Serverless - function-level, on-demand run
- Container - packaged, portable environment
- Managed platform - hosting company စီမံပေးသည်
CDN သည် content ကို ပထဝီဝင်အနေအထား အများအပြားတွင် cache လုပ်ထားပြီး user ကို အနီးဆုံးမှ ဆောင်ရွက်ပေးကာ latency နှင့် origin load ကို လျှော့ချသည်။
- Domain
- internet ပေါ်ရှိ site တစ်ခုကို ဖော်ပြရန် ဂဏန်းလိပ်စာအစား အသုံးပြုသော လူဖတ်နိုင်သည့် နာမည် (ဥပမာ example.com)
- DNS
- လူဖတ်နိုင်သော domain name များကို ၎င်းတို့ ညွှန်ပြသင့်သည့် address (သို့) destination များနှင့် ဆက်စပ်ပေးသော system
- CDN
- latency လျှော့ချရန်နှင့် origin server ပေါ်ရှိ load လျှော့ချရန် content ကို ပထဝီဝင်နေရာ များစွာတွင် cache လုပ်ပေးသော ဖြန့်ကျက်ထားသည့် server network
DOMAIN, DNS, HOSTING, AND CDN
-----------------------------
DOMAIN, DNS, HOSTING, AND CDN
-------------------------------
learn.example.com
|
v
[ DNS ] -- resolves the name to an address
|
v
[ Hosting / Origin Server ]
CDN EDGE CACHING
------------------
+----------------+
| Origin Server |
+----------------+
|
distributes cached copies to edges
|
------------------------------------------
| | |
[CDN: US East] [CDN: Europe] [CDN: Asia]
| | |
User (near) User (near) User (near)လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
ဥပမာအမှန်တစ်ခု - domain ကို ဝယ်၊ DNS ကို hosting ဆီညွှန်ပြ၊ static asset များကို CDN မှ ဆောင်ရွက်ပြီး dynamic request များကို origin ဆီ ပို့သည်။
အောက်ပါ code သည် request တစ်ခု၏ ဖော်ပြချက်ကိုကြည့်ပြီး DNS, CDN (သို့) Origin Server အနက် မည်သည့်အပိုင်းက ကိုင်တွယ်မည်ကို ဆုံးဖြတ်ပေးသည်။
အတူတူ စမ်းရေးကြည့်မယ်
function routeRequest(request) {
if (request.isFirstDnsLookup) {
return "DNS";
}
if (request.isStaticAsset) {
return "CDN";
}
return "Origin Server";
}
const examples = [
{ label: "First visit, resolving learn.example.com", isFirstDnsLookup: true },
{ label: "Loading a cached logo.png", isStaticAsset: true },
{ label: "Fetching /api/dashboard for a logged-in user", isStaticAsset: false },
];
examples.forEach((ex) => {
console.log(ex.label, "->", routeRequest(ex));
});routing ဆုံးဖြတ်ချက် သုံးခုကို log ထုတ်သည်: ပထမဆုံးအကြိမ် lookup ကို 'DNS' ဆီ ပို့ပြီး cache ထားသော ပုံသည် 'CDN' ဆီ ပို့ကာ dashboard API call ကို 'Origin Server' ဆီ ပို့သည်။၅ မိနစ် စမ်းကြည့်
နေ့စဉ်သုံးနေသော domain တစ်ခုကို မည်သည့်ကုမ္ပဏီက register လုပ်ထားသည်ကို ရှာပြီး static asset များကို မည်သည့်ကုမ္ပဏီက host/serve လုပ်နေသည်ကိုပါ သီးခြားစစ်ဆေးပါ (browser network panel သို့ DNS lookup tool ဖြင့် နှစ်ခုစလုံးကို တွေ့နိုင်သည်)။
သတိလေးတစ်ချက်
domain ဝယ်လိုက်ရုံနှင့် website တစ်ခု တစ်နေရာရာတွင် live ဖြစ်နေပြီဟု ယူဆခြင်း - domain သည် နာမည်တစ်ခုသာဖြစ်ပြီး hosting မဟုတ်ပါ။
registrar၊ DNS provider နှင့် host ကို အမြဲတမ်း ကုမ္ပဏီတစ်ခုတည်းဟု ယူဆခြင်း - အဆင်ပြေရန် တစ်ခုတည်းဖြစ်လေ့ရှိသော်လည်း architecture အရ role သီးခြားစီ ဖြစ်သည်။
Wikipedia - Domain Name System — How the Web Works