Cloud Fundamentals

Cloud for beginnersคลาวด์สำหรับผู้เริ่มต้น

Cloud Fundamentals

The ideas behind every cloud, learned onceแนวคิดเบื้องหลังทุกคลาวด์ เรียนครั้งเดียวใช้ได้ทุกที่

AWS, Azure and Google Cloud have hundreds of services with different names, but they rest on the same handful of ideas: rent computers by the minute, spread them over regions and zones, control who may do what, put them in private networks, store data in a few kinds of storage, and pay for exactly what you use. Learn those ideas here, then the provider guides (AWS, Azure, Google Cloud) show them in practice. AWS, Azure และ Google Cloud มีบริการหลายร้อยตัวที่ใช้ชื่อต่างกัน แต่ทั้งหมดตั้งอยู่บนแนวคิดไม่กี่ข้อเดียวกัน ได้แก่ เช่าคอมพิวเตอร์เป็นนาที กระจายไว้ตาม region และ zone ควบคุมว่าใครทำอะไรได้ วางไว้ในเครือข่ายส่วนตัว เก็บข้อมูลในที่เก็บไม่กี่แบบ และจ่ายตามที่ใช้จริง เรียนแนวคิดเหล่านั้นที่นี่ แล้วคู่มือของแต่ละผู้ให้บริการ (AWS, Azure, Google Cloud) จะแสดงการใช้งานจริง

The numbers in this guide (downtime, availability, permissions, subnets, cost) come from small programs you can run and edit in your browser. Each output shown first was recorded with Node.js 22, and the same code was run in a real browser before publishing, with identical output. ตัวเลขในคู่มือนี้ (เวลาที่ระบบล่ม ความพร้อมใช้งาน สิทธิ์ ซับเน็ต และค่าใช้จ่าย) มาจากโปรแกรมเล็กๆ ที่รันและแก้ไขได้ในเบราว์เซอร์ ผลลัพธ์ที่แสดงไว้ก่อนบันทึกจาก Node.js 22 และก่อนเผยแพร่ โค้ดชุดเดียวกันถูกรันในเบราว์เซอร์จริงแล้วได้ผลตรงกัน

Shortcut: pressคีย์ลัด: กด Ctrl+Enter (⌘+Enter Mac) inside a code box to run it.ในกล่องโค้ดเพื่อรันทันที

  • Coversครอบคลุม AWS · Azure · Google Cloud
  • Labs run inแล็บรันใน your browserเบราว์เซอร์ของคุณ

Lesson 1 · Foundationsบทที่ 1 · พื้นฐาน

What the cloud isคลาวด์คืออะไร

"The cloud" is someone else's data centres, rented through an API. Instead of buying servers, waiting weeks and guessing how many you'll need, you ask for computers, storage and databases with a click or a command, get them in minutes, and pay per second or per gigabyte while you use them. Three things make it different from renting a server: it's on demand, it's elastic (grow and shrink any time), and everything is controlled by an API, so it can be automated. "คลาวด์" คือศูนย์ข้อมูลของคนอื่นที่เราเช่าผ่าน API แทนที่จะซื้อเซิร์ฟเวอร์ รอหลายสัปดาห์ และเดาว่าต้องใช้กี่เครื่อง เราขอคอมพิวเตอร์ ที่เก็บข้อมูล และฐานข้อมูลได้ด้วยการคลิกหรือคำสั่งเดียว ได้มาในไม่กี่นาที และจ่ายเป็นวินาทีหรือเป็นกิกะไบต์เท่าที่ใช้ สามสิ่งที่ทำให้ต่างจากการเช่าเซิร์ฟเวอร์คือ ได้ทันทีเมื่อต้องการ (on demand) ยืดหยุ่น (elastic) ขยายและลดได้ทุกเมื่อ และทุกอย่าง ควบคุมผ่าน API จึงทำให้เป็นอัตโนมัติได้

ModelรูปแบบYou getสิ่งที่ได้You still manageสิ่งที่ยังต้องดูแลเองExamplesตัวอย่าง
IaaSvirtual machines, disks, networksvirtual machine ดิสก์ เครือข่ายthe OS and everything on itระบบปฏิบัติการและทุกอย่างบนนั้นEC2, Azure VMs, Compute Engine
PaaSa place to run your code or a managed databaseที่สำหรับรันโค้ด หรือฐานข้อมูลที่มีคนดูแลให้your code, data and settingsโค้ด ข้อมูล และการตั้งค่าของเราCloud Run, App Service, RDS
Serverlessrun a function per event; pay only while it runsรันฟังก์ชันต่อหนึ่งเหตุการณ์ จ่ายเฉพาะตอนที่ทำงานjust the functionเฉพาะตัวฟังก์ชันLambda, Azure Functions
SaaSa finished applicationแอปพลิเคชันที่พร้อมใช้your users and dataผู้ใช้และข้อมูลของเราGmail, GitHub, Microsoft 365
Why it mattersทำไมสำคัญ

The higher up the table, the more control you have and the more work you do. Moving down hands work to the provider (patching, scaling, backups) but ties you closer to that provider. Most teams mix them: managed databases, containers on a platform, and VMs only where they must.ยิ่งอยู่บนในตาราง เรายิ่งควบคุมได้มากและต้องทำงานเองมาก การขยับลงล่างคือส่งงานให้ผู้ให้บริการ (แพตช์ การขยาย การสำรองข้อมูล) แต่ก็ผูกติดกับผู้ให้บริการรายนั้นมากขึ้น ทีมส่วนใหญ่ใช้ผสมกัน คือฐานข้อมูลแบบ managed, container บนแพลตฟอร์ม และใช้ VM เฉพาะเมื่อจำเป็น

Lesson 2 · Foundationsบทที่ 2 · พื้นฐาน

Regions and availability zonesRegion และ availability zone

A region is a city-sized area with cloud data centres, such as Singapore, Jakarta or Bangkok. Inside a region are usually three or more availability zones: separate data centres with their own power, cooling and network, a few kilometres apart and joined by very fast links. A fire or power cut in one zone shouldn't touch the others. region คือพื้นที่ขนาดประมาณหนึ่งเมืองที่มีศูนย์ข้อมูลของคลาวด์ เช่น สิงคโปร์ จาการ์ตา หรือกรุงเทพฯ ภายใน region มักมี availability zone สามแห่งขึ้นไป คือศูนย์ข้อมูลที่แยกกันและมีไฟฟ้า ระบบทำความเย็น และเครือข่ายของตัวเอง อยู่ห่างกันไม่กี่กิโลเมตรและเชื่อมกันด้วยลิงก์ที่เร็วมาก ไฟไหม้หรือไฟดับใน zone หนึ่งไม่ควรกระทบ zone อื่น

Choosing a regionการเลือก regionWhyเหตุผล
close to your usersใกล้ผู้ใช้every request crosses the distance; a few thousand kilometres adds tens of millisecondsทุกคำขอต้องเดินทางตามระยะทาง ไม่กี่พันกิโลเมตรเพิ่มเวลาหลายสิบมิลลิวินาที
laws about dataกฎหมายเรื่องข้อมูลsome data must stay in the country (data residency)ข้อมูลบางประเภทต้องอยู่ในประเทศ (data residency)
services and priceบริการและราคาnot every service exists in every region, and prices differ by regionไม่ใช่ทุกบริการมีในทุก region และราคาต่างกันไปตาม region

Design rule: run important things in at least two zones. One zone failing is rare but normal; a whole region failing is very rare, and protecting against it (a second region) costs much more. The next lesson shows why two zones help so much. หลักการออกแบบคือ รันสิ่งที่สำคัญใน อย่างน้อยสอง zone zone หนึ่งล่มนั้นเกิดขึ้นได้แม้จะไม่บ่อย ส่วนทั้ง region ล่มนั้นเกิดขึ้นยากมาก และการป้องกัน (ใช้ region ที่สอง) มีค่าใช้จ่ายสูงกว่ามาก บทถัดไปจะแสดงว่าทำไมสอง zone จึงช่วยได้มาก

Lesson 3 · Foundationsบทที่ 3 · พื้นฐาน

Reliability and SLAsความน่าเชื่อถือและ SLA

Providers promise availability in a service level agreement (SLA), like "99.9% per month", and give credits if they miss it. The "nines" sound alike but mean very different amounts of downtime: ผู้ให้บริการสัญญาเรื่องความพร้อมใช้งานไว้ใน service level agreement (SLA) เช่น "99.9% ต่อเดือน" และคืนเครดิตถ้าทำไม่ได้ จำนวน "เลขเก้า" ฟังดูคล้ายกัน แต่หมายถึงเวลาที่ระบบล่มต่างกันมาก

Your app depends on several services in a chain: a load balancer, a VM, a database. It works only if all of them work, so their availabilities multiply, and the result is lower than any one of them. Running two VMs in different zones changes the picture: the app is down only if both are down at the same time. แอปของเราพึ่งพาหลายบริการต่อกันเป็นสาย เช่น load balancer, VM และฐานข้อมูล แอปทำงานได้ก็ต่อเมื่อทุกตัวทำงาน ความพร้อมใช้งานจึง คูณกัน และผลลัพธ์ต่ำกว่าตัวใดตัวหนึ่ง การรัน VM สองเครื่องในต่าง zone เปลี่ยนภาพนี้ เพราะแอปจะล่มก็ต่อเมื่อทั้งสองเครื่องล่มพร้อมกัน

The second VM cut expected downtime from about 69 to 26 minutes a month, and what's left now comes mostly from the database and the load balancer. That is the whole idea of high availability: find the single points of failure and give each one a partner in another zone. VM เครื่องที่สองลดเวลาที่คาดว่าจะล่มจากประมาณ 69 เหลือ 26 นาทีต่อเดือน และส่วนที่เหลือตอนนี้มาจากฐานข้อมูลและ load balancer เป็นหลัก นี่คือแนวคิดทั้งหมดของ high availability คือหาจุดที่ล้มแล้วระบบล่มทั้งหมด (single point of failure) แล้วให้แต่ละจุดมีคู่ใน zone อื่น

Lesson 4 · Foundationsบทที่ 4 · พื้นฐาน

Shared responsibilityความรับผิดชอบร่วม

The provider secures the cloud itself: buildings, hardware, the network, the virtualisation. You secure what you put in it. Where the line falls depends on the model; your data, your users and their permissions are always yours. ผู้ให้บริการดูแลความปลอดภัยของตัวคลาวด์ ได้แก่ อาคาร ฮาร์ดแวร์ เครือข่าย และระบบเสมือน ส่วน เรา ดูแลความปลอดภัยของสิ่งที่เรานำไปใส่ เส้นแบ่งอยู่ตรงไหนขึ้นกับรูปแบบบริการ แต่ข้อมูล ผู้ใช้ และสิทธิ์ของผู้ใช้เป็นของเราเสมอ

Who looks afterใครดูแลIaaSPaaSSaaS
data, users, permissionsข้อมูล ผู้ใช้ สิทธิ์youเราyouเราyouเรา
application codeโค้ดของแอปyouเราyouเราproviderผู้ให้บริการ
runtime, OS patches, firewall rules on the machineruntime แพตช์ระบบปฏิบัติการ กฎไฟร์วอลล์บนเครื่องyouเราproviderผู้ให้บริการproviderผู้ให้บริการ
hardware, network, buildingsฮาร์ดแวร์ เครือข่าย อาคารproviderผู้ให้บริการproviderผู้ให้บริการproviderผู้ให้บริการ

Most cloud security incidents happen on your side of the line: a storage bucket left public, a password in a Git repository, a firewall open to the whole internet. Lesson 12 shows the usual ones. เหตุการณ์ด้านความปลอดภัยบนคลาวด์ส่วนใหญ่เกิดฝั่ง เรา เช่น bucket ที่ถูกเปิดเป็นสาธารณะ รหัสผ่านใน Git repository หรือไฟร์วอลล์ที่เปิดให้ทั้งอินเทอร์เน็ต บทที่ 12 แสดงกรณีที่พบบ่อย

Lesson 5 · Building blocksบทที่ 5 · ส่วนประกอบ

Identity and accessตัวตนและสิทธิ์การเข้าถึง

Every API call to a cloud is made by an identity, a principal: a person, or a program using a role (a service account). Policies say which actions a principal may perform on which resources. Clouds evaluate them in the same spirit: everything is denied unless something allows it, and an explicit deny always wins. Here is a tiny version of that logic: ทุกการเรียก API ของคลาวด์ทำโดยตัวตนหนึ่งที่เรียกว่า principal ซึ่งอาจเป็นคน หรือโปรแกรมที่ใช้ role (service account) policy บอกว่า principal ทำ action ใดกับทรัพยากรใดได้บ้าง คลาวด์ประเมินด้วยหลักเดียวกัน คือทุกอย่างถูกปฏิเสธ เว้นแต่มีสิ่งที่อนุญาต และการปฏิเสธอย่างชัดแจ้ง (explicit deny) ชนะเสมอ นี่คือตรรกะนั้นในแบบย่อ

RuleหลักการIn practiceในทางปฏิบัติ
Least privilegeสิทธิ์น้อยที่สุดgive each identity only the actions and resources it needs; widen later if neededให้แต่ละตัวตนเฉพาะ action และทรัพยากรที่จำเป็น ค่อยขยายภายหลังถ้าต้องการ
Roles, not keysใช้ role ไม่ใช่กุญแจprograms on cloud machines get short-lived credentials from a role; no long-lived keys in codeโปรแกรมบนเครื่องในคลาวด์ได้ข้อมูลยืนยันตัวตนอายุสั้นจาก role ไม่มีกุญแจอายุยาวในโค้ด
Protect the root accountปกป้องบัญชี rootturn on MFA, don't use it day to day, create named users or single sign-on insteadเปิด MFA ไม่ใช้ในงานประจำวัน แล้วสร้างผู้ใช้ที่มีชื่อหรือใช้ single sign-on แทน

Lesson 6 · Building blocksบทที่ 6 · ส่วนประกอบ

Cloud networksเครือข่ายบนคลาวด์

A virtual private cloud (VPC on AWS and Google Cloud, VNet on Azure) is your own private network inside the cloud, with an address range you choose, like 10.0.0.0/16. You divide it into subnets. A public subnet has a route to the internet (for load balancers); a private subnet doesn't (for app servers and databases), and reaches out only through a NAT gateway. The subnet maths is the same as in the Networking guide: virtual private cloud (VPC บน AWS และ Google Cloud, VNet บน Azure) คือเครือข่ายส่วนตัวของเราภายในคลาวด์ โดยเลือกช่วง address เอง เช่น 10.0.0.0/16 แล้วแบ่งเป็น ซับเน็ต ซับเน็ต สาธารณะ มีเส้นทางออกอินเทอร์เน็ต (สำหรับ load balancer) ส่วนซับเน็ต ส่วนตัว ไม่มี (สำหรับเซิร์ฟเวอร์แอปและฐานข้อมูล) และออกไปข้างนอกได้ผ่าน NAT gateway เท่านั้น การคำนวณซับเน็ตเหมือนใน คู่มือ Networking

One public and one private subnet per zone, three zones: the usual layout. Private subnets are made big because that's where the servers and containers live. Traffic is then filtered by security groups (AWS), network security groups (Azure) or firewall rules (Google Cloud): lists of allowed ports and sources, with everything else dropped, exactly like the firewall in the Networking guide. ซับเน็ตสาธารณะหนึ่งวงและส่วนตัวหนึ่งวงต่อ zone รวมสาม zone คือรูปแบบที่ใช้กันทั่วไป ซับเน็ตส่วนตัวทำให้ใหญ่ เพราะเป็นที่อยู่ของเซิร์ฟเวอร์และ container จากนั้นการรับส่งข้อมูลจะถูกกรองด้วย security group (AWS), network security group (Azure) หรือ firewall rule (Google Cloud) ซึ่งเป็นรายการพอร์ตและต้นทางที่อนุญาต ที่เหลือถูกทิ้งทั้งหมด เหมือนไฟร์วอลล์ในคู่มือ Networking

Lesson 7 · Building blocksบทที่ 7 · ส่วนประกอบ

Computeการประมวลผล

There are three main ways to run code, from most control to least work: วิธีหลักในการรันโค้ดมีสามแบบ เรียงจากควบคุมได้มากที่สุดไปถึงทำงานน้อยที่สุด

OptionทางเลือกGood forเหมาะกับWatch out forข้อควรระวัง
Virtual machinesVirtual machineanything; old software; full control of the OSทุกอย่าง ซอฟต์แวร์เก่า และควบคุมระบบปฏิบัติการได้เต็มที่you patch and scale them; you pay while they're on, busy or notต้องแพตช์และขยายเอง และจ่ายตลอดที่เปิดไว้ ไม่ว่าจะมีงานหรือไม่
ContainersContainermost web apps and APIs; the same image everywhere (Docker, Kubernetes, or a simpler container platform)เว็บแอปและ API ส่วนใหญ่ image เดียวกันใช้ได้ทุกที่ (Docker, Kubernetes หรือแพลตฟอร์ม container ที่ง่ายกว่า)Kubernetes itself is a lot to run; start with a managed platformการดูแล Kubernetes เองเป็นงานใหญ่ ควรเริ่มจากแพลตฟอร์มแบบ managed
Functionsฟังก์ชันshort tasks triggered by events: an upload, a message, a schedule, an HTTP callงานสั้นๆ ที่ถูกเรียกด้วยเหตุการณ์ เช่น การอัปโหลด ข้อความ ตารางเวลา หรือการเรียก HTTPtime limits, "cold starts" after idle, and hard-to-predict bills at very high volumeมีเวลาจำกัด มี "cold start" หลังว่างนาน และค่าใช้จ่ายคาดเดายากเมื่อปริมาณสูงมาก

Autoscaling adds machines or containers when load rises and removes them when it falls, based on CPU, requests or queue length. It's the "elastic" in Lesson 1, and the main reason the cloud can be cheaper than owning servers: you stop paying for capacity you only need at peak. Autoscaling เพิ่มเครื่องหรือ container เมื่อโหลดสูงขึ้น และลดลงเมื่อโหลดต่ำลง โดยอิงจาก CPU จำนวนคำขอ หรือความยาวของคิว นี่คือความ "ยืดหยุ่น" ในบทที่ 1 และเป็นเหตุผลหลักที่คลาวด์ถูกกว่าการมีเซิร์ฟเวอร์เอง เพราะไม่ต้องจ่ายค่ากำลังเครื่องที่ต้องใช้เฉพาะช่วงพีก

Lesson 8 · Building blocksบทที่ 8 · ส่วนประกอบ

Storage and databasesที่เก็บข้อมูลและฐานข้อมูล

KindประเภทWhat it isคืออะไรUse it forใช้สำหรับ
Object storageObject storagefiles ("objects") in buckets, read and written over HTTP; practically unlimited and very durableไฟล์ ("object") ใน bucket อ่านเขียนผ่าน HTTP แทบไม่จำกัดขนาดและทนทานมากuploads, images, backups, logs, static websitesไฟล์อัปโหลด รูปภาพ ข้อมูลสำรอง log และเว็บไซต์แบบ static
Block storageBlock storagea virtual disk attached to one VMดิสก์เสมือนที่ต่อกับ VM หนึ่งเครื่องthe VM's operating system, a self-run databaseระบบปฏิบัติการของ VM และฐานข้อมูลที่ดูแลเอง
File storageFile storagea shared network folder (NFS/SMB) many machines can mountโฟลเดอร์เครือข่ายที่ใช้ร่วมกัน (NFS/SMB) ซึ่งหลายเครื่อง mount ได้older apps that expect a shared diskแอปรุ่นเก่าที่ต้องการดิสก์ร่วม
Managed SQL databaseฐานข้อมูล SQL แบบ managedPostgreSQL or MySQL run for you, with backups, patches and a standby in another zonePostgreSQL หรือ MySQL ที่มีคนรันให้ พร้อมการสำรองข้อมูล แพตช์ และเครื่องสำรองในอีก zonemost application dataข้อมูลของแอปพลิเคชันส่วนใหญ่
NoSQL databaseฐานข้อมูล NoSQLkey-value or document stores that scale very farที่เก็บแบบ key-value หรือ document ที่ขยายได้มากsessions, carts, huge simple tables, global appssession ตะกร้าสินค้า ตารางขนาดใหญ่ที่เรียบง่าย และแอประดับโลก
Durability vs availabilityความทนทาน กับ ความพร้อมใช้งาน

Object storage is often quoted at "eleven nines" of durability: the chance of losing a file is tiny, because copies are kept in several zones. Its availability (being able to read it right now) is a separate, lower number. Durability doesn't protect you from deleting a file yourself: turn on versioning and keep backups.object storage มักถูกอ้างว่ามี ความทนทาน "เก้าสิบเอ็ดตัว" คือโอกาสที่ไฟล์จะ หายไป น้อยมาก เพราะเก็บสำเนาไว้หลาย zone ส่วน ความพร้อมใช้งาน (อ่านได้ทันที) เป็นอีกตัวเลขหนึ่งที่ต่ำกว่า ความทนทานไม่ได้ป้องกันการที่เราลบไฟล์เอง ให้เปิด versioning และเก็บข้อมูลสำรองไว้

Lesson 9 · Money and mapsบทที่ 9 · เงินและแผนที่

Costค่าใช้จ่าย

Cloud bills come from a few meters: compute time (per second or hour), storage (per GB per month), requests, and data transfer out of the cloud (per GB). Data coming in is usually free; data going out to the internet is not, and it surprises many teams. Here's an example month with three small VMs, 500 GB of files and 2 TB downloaded by users: ค่าใช้จ่ายของคลาวด์มาจากมิเตอร์ไม่กี่ตัว ได้แก่ เวลาประมวลผล (ต่อวินาทีหรือชั่วโมง) ที่เก็บข้อมูล (ต่อ GB ต่อเดือน) จำนวนคำขอ และ ข้อมูลที่ส่งออก จากคลาวด์ (ต่อ GB) ข้อมูลขาเข้ามักไม่เสียเงิน แต่ข้อมูลขาออกไปยังอินเทอร์เน็ตเสียเงิน และทำให้หลายทีมประหลาดใจ นี่คือตัวอย่างหนึ่งเดือนที่มี VM ขนาดเล็กสามเครื่อง ไฟล์ 500 GB และผู้ใช้ดาวน์โหลด 2 TB

In this example the data leaving the cloud costs more than the servers. A CDN, compression and caching cut it. ในตัวอย่างนี้ข้อมูลที่ออกจากคลาวด์มีค่าใช้จ่ายมากกว่าเซิร์ฟเวอร์ CDN การบีบอัด และการแคชช่วยลดได้

Way to payวิธีจ่ายFitsเหมาะกับ
On demandOn demandnew or changing workloads; full price, no promiseงานใหม่หรืองานที่เปลี่ยนบ่อย จ่ายราคาเต็ม ไม่มีข้อผูกมัด
Commitmentsการผูกมัดระยะยาวsteady workloads; promise 1 or 3 years of use for a large discount (reserved instances, savings plans, committed use)งานที่คงที่ สัญญาว่าจะใช้ 1 หรือ 3 ปีเพื่อรับส่วนลดมาก (reserved instance, savings plan, committed use)
Spot / preemptibleSpot / preemptiblespare capacity at a deep discount that can be taken back at short notice: batch jobs, CI runnersกำลังเครื่องที่เหลือในราคาลดมาก แต่อาจถูกเรียกคืนในเวลาอันสั้น เหมาะกับงาน batch และ CI runner
Day oneวันแรก

Before creating anything, set a budget with an email alert. Then tag resources by project, and delete what you don't use: forgotten test machines, unattached disks and old snapshots are the classic waste.ก่อนสร้างอะไร ให้ตั้ง งบประมาณพร้อมการแจ้งเตือนทางอีเมล จากนั้นติดแท็กทรัพยากรตามโปรเจกต์ และลบสิ่งที่ไม่ใช้ เครื่องทดสอบที่ลืมไว้ ดิสก์ที่ไม่ได้ต่อกับเครื่อง และ snapshot เก่าคือการสิ้นเปลืองแบบคลาสสิก

Lesson 10 · Money and mapsบทที่ 10 · เงินและแผนที่

The same thing on AWS, Azure and Google Cloudสิ่งเดียวกันบน AWS, Azure และ Google Cloud

Once you know the idea, a new cloud is mostly new names. Some equivalents are close rather than exact. เมื่อเข้าใจแนวคิดแล้ว คลาวด์ใหม่ส่วนใหญ่ก็แค่ชื่อใหม่ บางบริการเทียบได้ใกล้เคียง ไม่ได้เหมือนกันทุกประการ

IdeaแนวคิดAWSAzureGoogle Cloud
virtual machinesvirtual machineEC2Virtual MachinesCompute Engine
managed KubernetesKubernetes แบบ managedEKSAKSGKE
simple container platformแพลตฟอร์ม container แบบง่ายECS on Fargate, App RunnerContainer AppsCloud Run
functionsฟังก์ชันLambdaFunctionsCloud Run functions
object storageobject storageS3Blob StorageCloud Storage
block storageblock storageEBSManaged DisksPersistent Disk
managed SQLSQL แบบ managedRDS, AuroraAzure Database for PostgreSQL/MySQL, Azure SQLCloud SQL, AlloyDB
NoSQLNoSQLDynamoDBCosmos DBFirestore, Bigtable
message queueคิวข้อความSQS, SNSService Bus, Queue StoragePub/Sub
private networkเครือข่ายส่วนตัวVPCVirtual Network (VNet)VPC
firewallไฟร์วอลล์Security groupsNetwork security groupsFirewall rules
identity and accessตัวตนและสิทธิ์IAMEntra ID + Azure RBACIAM
DNS / CDNDNS / CDNRoute 53 / CloudFrontAzure DNS / Front DoorCloud DNS / Cloud CDN
monitoring and logsการติดตามและ logCloudWatchAzure MonitorCloud Monitoring, Cloud Logging
infrastructure as codeinfrastructure as codeCloudFormationBicep / ARM templatesInfrastructure Manager

Terraform (or OpenTofu) works with all three, which is why many teams use it for infrastructure as code. The provider guides in this series run each cloud's own tools against local emulators, so you can practise without an account or a bill. Terraform (หรือ OpenTofu) ใช้ได้กับทั้งสามคลาวด์ หลายทีมจึงใช้มันทำ infrastructure as code คู่มือของแต่ละผู้ให้บริการในชุดนี้จะรันเครื่องมือของคลาวด์นั้นกับ emulator ในเครื่อง จึงฝึกได้โดยไม่ต้องมีบัญชีและไม่มีค่าใช้จ่าย

Lesson 11 · Your turnบทที่ 11 · ถึงตาคุณแล้ว

Practiceแบบฝึกหัด

1. Three zones1. สาม zone

How available is the app from Lesson 3 with VMs in three zones, and how many minutes a month is that? Then make the database the weakest link: what happens if it has two copies in two zones?แอปจากบทที่ 3 พร้อมใช้งานแค่ไหนเมื่อมี VM ในสาม zone และเท่ากับกี่นาทีต่อเดือน จากนั้นลองดูจุดอ่อนที่สุดคือฐานข้อมูล ถ้ามันมีสองชุดในสอง zone จะเป็นอย่างไร

2. Let uploaders tidy up2. ให้ผู้อัปโหลดลบไฟล์ได้

Change the policy from Lesson 5 so s3:DeleteObject is allowed in photos/uploads/ only. Test a delete in uploads, one in the top folder, and one in private.แก้ policy จากบทที่ 5 ให้อนุญาต s3:DeleteObject เฉพาะใน photos/uploads/ แล้วทดสอบการลบใน uploads ในโฟลเดอร์บนสุด และใน private

Lesson 12 · Avoiding troubleบทที่ 12 · หลีกเลี่ยงปัญหา

Common mistakesข้อผิดพลาดที่พบบ่อย

These are the mistakes behind most cloud incidents and surprise bills. The examples are written in the style of AWS; the same settings exist on every cloud. นี่คือข้อผิดพลาดเบื้องหลังเหตุการณ์และค่าใช้จ่ายที่ไม่คาดคิดบนคลาวด์ส่วนใหญ่ ตัวอย่างเขียนในรูปแบบของ AWS แต่การตั้งค่าแบบเดียวกันมีในทุกคลาวด์

Access keys in the codeกุญแจเข้าถึงอยู่ในโค้ด

Keys committed to Git get found by bots within minutes and used to run crypto miners on your bill. Programs in the cloud should use a role; on your laptop, use your own short-lived login.กุญแจที่ถูก commit ลง Git จะถูกบอตพบภายในไม่กี่นาที และถูกใช้รันเครื่องขุดคริปโตบนบิลของเรา โปรแกรมในคลาวด์ควรใช้ role ส่วนบนโน้ตบุ๊กให้ใช้การล็อกอินอายุสั้นของเราเอง

✗ Wrong✗ ผิด
✓ Right✓ ถูก

SSH open to the whole internetเปิด SSH ให้ทั้งอินเทอร์เน็ต

0.0.0.0/0 means "from anywhere". Bots scan every public address all day; an open port 22 gets password attempts within minutes.0.0.0.0/0 แปลว่า "จากที่ไหนก็ได้" บอตสแกนทุก address สาธารณะตลอดทั้งวัน พอร์ต 22 ที่เปิดไว้จะถูกลองรหัสผ่านภายในไม่กี่นาที

✗ Wrong✗ ผิด
✓ Right✓ ถูก

A public bucket for private filesbucket สาธารณะสำหรับไฟล์ส่วนตัว

Leaked customer data very often comes from storage set to public "for a quick test". Keep buckets private (the default on new buckets) and hand out short-lived signed links when someone needs one file.ข้อมูลลูกค้าที่รั่วไหลมักมาจากที่เก็บข้อมูลที่ถูกตั้งเป็นสาธารณะ "เพื่อทดสอบเร็วๆ" ให้เก็บ bucket เป็นส่วนตัว (ค่าเริ่มต้นของ bucket ใหม่) และให้ลิงก์ที่ลงนามแล้วอายุสั้นเมื่อมีคนต้องการไฟล์เดียว

✗ Wrong✗ ผิด
✓ Right✓ ถูก

Everything in one zoneทุกอย่างอยู่ใน zone เดียว

It's cheaper and simpler until that zone has a bad day. Lesson 3's lab shows what a second zone is worth.ถูกกว่าและง่ายกว่า จนกว่า zone นั้นจะมีปัญหา แล็บในบทที่ 3 แสดงว่า zone ที่สองมีคุณค่าแค่ไหน

✗ Wrong✗ ผิด
✓ Right✓ ถูก

No budget alertไม่มีการแจ้งเตือนงบประมาณ

A loop that writes to storage, a forgotten GPU machine or a sudden download spike can cost more in a weekend than a month of normal use. An alert can't stop it, but it tells you on Saturday instead of at the end of the month.ลูปที่เขียนลงที่เก็บข้อมูลไม่หยุด เครื่อง GPU ที่ลืมปิด หรือการดาวน์โหลดที่พุ่งขึ้นกะทันหัน อาจเสียเงินในหนึ่งสุดสัปดาห์มากกว่าการใช้งานปกติทั้งเดือน การแจ้งเตือนหยุดมันไม่ได้ แต่บอกเราในวันเสาร์ แทนที่จะเป็นตอนสิ้นเดือน

✗ Wrong✗ ผิด
✓ Right✓ ถูก

Lesson 13 · Referenceบทที่ 13 · อ้างอิง

Glossaryคำศัพท์

EnglishไทยMeaningความหมาย
region / zoneรีเจียน / โซนA geographic area / one independent data centre in itพื้นที่ทางภูมิศาสตร์ / ศูนย์ข้อมูลอิสระหนึ่งแห่งในพื้นที่นั้น
IaaS / PaaS / SaaSIaaS / PaaS / SaaSRent machines / a platform / a finished appเช่าเครื่อง / เช่าแพลตฟอร์ม / ใช้แอปสำเร็จรูป
serverlessเซิร์ฟเวอร์เลสYou run code without managing servers; billed per useรันโค้ดโดยไม่ต้องดูแลเซิร์ฟเวอร์ คิดเงินตามการใช้
SLASLAThe provider's availability promise, with credits if missedคำสัญญาเรื่องความพร้อมใช้งานของผู้ให้บริการ พร้อมเครดิตถ้าทำไม่ได้
high availabilityความพร้อมใช้งานสูงStaying up when one part fails, usually by spreading over zonesยังทำงานได้เมื่อส่วนหนึ่งล้ม มักทำโดยกระจายไปหลาย zone
principal / roleprincipal / roleWho makes a call / an identity programs assumeผู้เรียก API / ตัวตนที่โปรแกรมสวมบทบาท
policyนโยบายRules of which actions are allowed on which resourcesกฎว่า action ใดทำได้กับทรัพยากรใด
least privilegeสิทธิ์น้อยที่สุดOnly the permissions really neededให้เฉพาะสิทธิ์ที่จำเป็นจริงๆ
VPC / VNet / subnetVPC / VNet / ซับเน็ตYour private network in the cloud / a part of itเครือข่ายส่วนตัวของเราในคลาวด์ / ส่วนหนึ่งของเครือข่ายนั้น
security groupsecurity groupA firewall attached to resourcesไฟร์วอลล์ที่ผูกกับทรัพยากร
autoscalingการขยายอัตโนมัติAdding and removing capacity with the loadเพิ่มและลดกำลังเครื่องตามโหลด
bucket / objectบัคเก็ต / ออบเจกต์A container in object storage / a file in itภาชนะใน object storage / ไฟล์ในนั้น
egressข้อมูลขาออกData leaving the cloud, usually billed per GBข้อมูลที่ออกจากคลาวด์ มักคิดเงินต่อ GB
infrastructure as codeinfrastructure as codeDescribing cloud resources in files that tools applyการอธิบายทรัพยากรบนคลาวด์ในไฟล์ แล้วให้เครื่องมือสร้างตาม