Docker DevOps Infrastructure

Docker Containers vs VMs — ต่างกันยังไง ใช้ตัวไหนดี?Docker Containers vs VMs — What's the Difference, and Which Should You Use?

By Anirach Mingkhwan DevOps & Vibe Coding 2026 · 13 min read
Docker vs VMs — ต่างกันยังไง ใช้ตัวไหนดี
ในบทความนี้
  1. Virtual Machine (VM) คืออะไร?
  2. Docker Container คืออะไร?
  3. เปรียบเทียบ VM vs Container
  4. Docker ทำงานยังไง?
  5. ตัวอย่างจริง: Deploy Web App
  6. Docker Compose — รันหลาย Container พร้อมกัน
  7. แล้วเมื่อไหร่ควรใช้อะไร?
  8. คำสั่ง Docker ที่ใช้บ่อย — สรุป
  9. สรุป
In this post
  1. What Is a Virtual Machine (VM)?
  2. What Is a Docker Container?
  3. VM vs Container, Side by Side
  4. How Does Docker Work?
  5. A Real Example: Deploying a Web App
  6. Docker Compose — Running Several Containers at Once
  7. So When Should You Use Which?
  8. The Docker Commands You'll Actually Use — A Summary
  9. Summary

จากโพสต์ที่แล้วเราพูดถึง CI/CD Pipeline ว่ามันช่วยให้เรา build, test, deploy แบบอัตโนมัติ

แต่เคยมั้ยที่... "ในเครื่องฉันรันได้นะ แต่ขึ้น server แล้วพัง" 🤦

ปัญหานี้เกิดจากความแตกต่างของ environment — เวอร์ชันของ OS, library, config ต่างกัน ทำให้ code ที่ทำงานได้ในเครื่องเรากลับพังในเครื่องอื่น

วิธีแก้คือ ทำให้ทุกที่ใช้ environment เดียวกัน ซึ่งมี 2 แนวทางหลัก:

  1. Virtual Machines (VMs) — จำลองเครื่องคอมพิวเตอร์ทั้งเครื่อง
  2. Docker Containers — จำลองแค่สิ่งที่ app ต้องการ

มาดูกันว่าทั้งสองอย่างคืออะไร ต่างกันยังไง แล้วควรใช้ตัวไหนเมื่อไหร่


Virtual Machine (VM) คืออะไร?

VM (Virtual Machine) คือการจำลองคอมพิวเตอร์ทั้งเครื่องด้วย software — มี CPU, RAM, Disk, Network เสมือนครบ รันอยู่บนเครื่องจริง (Host) ผ่าน Hypervisor ที่จัดสรร resource ให้แต่ละ VM เหมือนแบ่งห้องในอพาร์ทเมนท์ — แต่ละ VM เป็นอิสระจากกัน ติดตั้ง OS ต่างกันได้ แม้ VM หนึ่งพังก็ไม่กระทบ VM อื่น

Host Machine
Hypervisor
VM 1
App
Libs
Guest OS
VM 2
App
Libs
Guest OS
Host OS
Hardware

สังเกตว่า แต่ละ VM มี Guest OS ของตัวเอง ทำให้:

  • ✅ แยกจากกันสมบูรณ์ (isolation สูงมาก)
  • ✅ รัน OS ต่างกันได้ (Windows บน Linux host)
  • ❌ แต่กิน RAM, CPU, Disk เยอะมาก
  • ❌ เปิดช้า (boot OS ทั้งเครื่อง)

Hypervisor ยอดนิยม:

  • Type 1 (Bare-metal): VMware ESXi, Hyper-V, Proxmox — รันบน hardware ตรงๆ
  • Type 2 (Hosted): VirtualBox, VMware Workstation — รันบน OS อีกที

Docker Container คืออะไร?

Container คือการจำลองแค่ environment ที่ app ต้องการ — ไม่ต้องจำลอง OS ทั้งตัว! Container ใช้ kernel ร่วมกับ Host OS แล้วใช้ Linux features (namespaces, cgroups) แยก process, filesystem, network ของแต่ละ container ผลลัพธ์คือ: เบามาก (MB แทน GB), เร็วมาก (เริ่มในวินาที แทนนาที), และ portable (รันได้ทุกที่ที่มี Docker)

Host Machine
Container 1
App
Libs
Container 2
App
Libs
Container 3
App
Libs
Docker Engine
Host OS
Hardware

สังเกตว่า ไม่มี Guest OS — container ใช้ kernel ของ Host OS ร่วมกัน ทำให้:

  • ✅ เบามาก (MB vs GB)
  • ✅ เปิดเร็วมาก (วินาที vs นาที)
  • ✅ รันได้หลาย container พร้อมกัน
  • ❌ ต้องเป็น Linux kernel เดียวกัน (บน Mac/Windows ใช้ VM เล็กๆ ซ่อนอยู่)
  • ❌ isolation น้อยกว่า VM

เปรียบเทียบ VM vs Container

ตารางด้านล่างเปรียบเทียบ VM กับ Container ในทุกมิติ — สังเกตว่า Container เร็วกว่า เบากว่า และ scale ง่ายกว่าในเกือบทุกด้าน แต่ VM ยังมีข้อดีด้าน isolation ที่แข็งแกร่งกว่า (แยก kernel) และรองรับ ต่าง OS ได้ (เช่น รัน Windows บน Linux host):

Virtual MachineDocker Container
ขนาดหลาย GB (มี OS เต็ม)หลัก MB — ร้อย MB
เวลาเปิดนาที (boot OS)วินาที
PerformanceOverhead จาก Hypervisorใกล้เคียง native
Isolationสูงมาก (แยก OS)ปานกลาง (แชร์ kernel)
จำนวนที่รันได้5-20 ต่อเครื่อง100+ ต่อเครื่อง
OS ต่างกันได้ได้ (Windows บน Linux)ไม่ได้ (ต้อง Linux kernel)
ใช้ RAMจอง RAM ทั้งก้อนใช้เท่าที่ต้องการ
Portabilityย้ายยาก (ไฟล์ใหญ่)ย้ายง่าย (Image เล็ก)

Docker ทำงานยังไง?

Docker ทำงานบน client-server architecture — Docker CLI (client) ส่งคำสั่งไปยัง Docker Engine (daemon) ที่จัดการ images และ containers มี 3 concepts หลักที่ต้องเข้าใจ เปรียบเทียบกับ OOP: Dockerfile = source code, Image = class, Container = object:

1. Dockerfile — สูตรทำ Image

Dockerfile คือ text file ที่บอกว่าต้องเตรียม environment ยังไง ทีละขั้น — เริ่มจาก base image (เช่น Node.js 20), copy source code เข้าไป, install dependencies, กำหนด port, กำหนด command ที่รันตอน start เหมือนสูตรทำอาหาร — ทำตามขั้นตอนได้ผลเหมือนกันทุกครั้ง:

# เริ่มจาก base image
FROM node:20-alpine

# ตั้ง working directory
WORKDIR /app

# copy package.json แล้วติดตั้ง dependencies
COPY package*.json ./
RUN npm ci --production

# copy source code
COPY . .

# บอกว่า app ใช้ port อะไร
EXPOSE 3000

# คำสั่งรัน app
CMD ["node", "server.js"]

2. Image — สิ่งที่ได้จาก Dockerfile

Image คือ snapshot ของ environment ที่พร้อมรัน — ผลลัพธ์จากการ docker build Dockerfile Image เก็บทุกอย่างที่ app ต้องการ (OS libs, runtime, code, configs) แชร์ผ่าน Docker Hub หรือ private registry ได้ เหมือนแผ่น CD ที่ burn แล้ว — copy ไปรันที่ไหนก็ได้:

# สร้าง image จาก Dockerfile
docker build -t my-app:v1 .

# ดู images ทั้งหมด
docker images

Image เป็น read-only — เหมือน class ใน OOP

3. Container — Instance ที่รันจาก Image

Container คือ image ที่กำลังทำงานอยู่ — สร้างจาก docker run จาก image เดียวสร้าง container ได้หลายตัว แต่ละตัวมี filesystem, network, process space แยกกัน เหมือน object ที่ new จาก class ใน OOP:

# รัน container จาก image
docker run -d -p 3000:3000 --name my-app my-app:v1

# ดู container ที่กำลังรัน
docker ps

# หยุด / ลบ container
docker stop my-app
docker rm my-app

ความสัมพันธ์:

Dockerfile
สูตร
→ build →
Image
แผ่น CD
→ run →
Container
เครื่องเล่น

ตัวอย่างจริง: Deploy Web App

มาเปรียบเทียบขั้นตอนจริงในการ deploy web app ทั้งแบบ VM (วิธีเดิม) กับ Docker (วิธีใหม่) — จะเห็นว่า Docker ลดขั้นตอนได้มาก และที่สำคัญคือ ทุกคนได้ environment เดียวกัน ไม่มี "แต่ในเครื่องฉันมันรันได้นะ" อีกต่อไป:

แบบ VM (วิธีเดิม)

ต้อง SSH เข้า server, ติดตั้ง OS, install dependencies ทีละตัว, configure ทุกอย่างด้วยมือ — ถ้าต้องทำ 10 servers ก็ทำซ้ำ 10 รอบ ถ้าลืมขั้นตอนก็พัง:

# 1. สร้าง VM ใหม่
# 2. ติดตั้ง Ubuntu
# 3. ติดตั้ง Node.js
sudo apt update
sudo apt install nodejs npm

# 4. copy code ไปที่ VM
scp -r ./my-app user@vm-ip:/home/user/

# 5. ติดตั้ง dependencies
cd /home/user/my-app && npm install

# 6. รัน app
node server.js

# ใช้เวลา: 15-30 นาที 😩
# ถ้ามี 3 servers = ทำ 3 รอบ 😩😩😩

แบบ Docker

เขียน Dockerfile ครั้งเดียว แล้ว docker build + docker run ได้เลย — ไม่ว่า dev, staging, production ได้ environment เดียวกันหมด ถ้าต้อง deploy 10 servers ก็แค่ docker run 10 ครั้ง (หรือใช้ K8s จัดการให้):

# 1. สร้าง image (ครั้งเดียว)
docker build -t my-app:v1 .

# 2. รัน (ที่ไหนก็ได้)
docker run -d -p 3000:3000 my-app:v1

# ใช้เวลา: 1-2 นาที 🎉
# ถ้ามี 3 servers = docker run 3 ที 🎉🎉🎉

Docker Compose — รันหลาย Container พร้อมกัน

App จริงไม่ได้มีแค่ container เดียว — มี web server + database + cache + message queue + ... ถ้าต้อง docker run ทีละตัว ตั้ง network เอง ตั้ง volume เอง จะยุ่งมาก! Docker Compose แก้ปัญหานี้โดยกำหนดทุก service ในไฟล์ YAML เดียว แล้วรันทั้งหมดด้วย docker compose up คำสั่งเดียว:

# docker-compose.yml
version: '3.8'

services:
  web:
    build: .
    ports:
      - "3000:3000"
    environment:
      - DATABASE_URL=postgres://db:5432/myapp
    depends_on:
      - db
      - redis

  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: myapp
      POSTGRES_PASSWORD: secret
    volumes:
      - pgdata:/var/lib/postgresql/data

  redis:
    image: redis:7-alpine

volumes:
  pgdata:
# เปิดทุก service พร้อมกัน
docker compose up -d

# ปิดทุก service
docker compose down

แค่คำสั่งเดียว ได้ web + database + cache พร้อมรัน ✅


แล้วเมื่อไหร่ควรใช้อะไร?

ส่วนใหญ่คำตอบคือ Docker — แต่มีบาง use cases ที่ VM ยังจำเป็น:

ใช้ Docker Container เมื่อ:

  • 🐳 ต้องการ deploy app เร็วๆ
  • 🐳 อยาก environment เหมือนกันทุกที่ (dev = staging = production)
  • 🐳 ต้องรัน microservices หลายตัว
  • 🐳 ใช้กับ CI/CD pipeline
  • 🐳 ต้อง scale ขึ้น/ลงเร็ว (Kubernetes)

ใช้ VM เมื่อ:

  • 🖥️ ต้องรัน OS ต่างกัน (Windows app บน Linux host)
  • 🖥️ ต้องการ security isolation สูงมาก (multi-tenant, compliance)
  • 🖥️ รัน legacy app ที่ต้องการ OS เฉพาะ
  • 🖥️ ต้องการ full control ของ OS (kernel tuning, custom drivers)

ใช้ทั้งสอง:

ในองค์กรขนาดใหญ่มักใช้ทั้งคู่: VM เป็น infrastructure layer + Container รันอยู่บน VM

Cloud providers (AWS, GCP, Azure) ใช้ VM เป็น backend แล้วให้เรารัน container บน VM อีกที

Kubernetes — Pod · Pod · Pod ← Containers
VM (EC2) ← Virtual Machine
Physical Server ← Hardware

คำสั่ง Docker ที่ใช้บ่อย — สรุป

Docker commands ที่ DevOps ใช้ทุกวัน — ไม่ต้องจำทั้งหมด แค่รู้ว่ามีอะไรบ้าง แล้ว docker --help เมื่อต้องการ คำสั่งที่ใช้บ่อยที่สุดคือ docker build, docker run, docker ps, docker logs:

# === Images ===
docker build -t app:v1 .           # สร้าง image
docker images                       # ดู images ทั้งหมด
docker pull nginx:latest            # ดึง image จาก Docker Hub
docker rmi app:v1                   # ลบ image

# === Containers ===
docker run -d -p 8080:80 nginx     # รัน container
docker ps                           # ดู container ที่รันอยู่
docker ps -a                        # ดูทั้งหมด (รวมที่หยุดแล้ว)
docker stop <container_id>          # หยุด
docker rm <container_id>            # ลบ
docker logs <container_id>          # ดู logs
docker exec -it <id> /bin/sh        # เข้าไปใน container

# === Docker Compose ===
docker compose up -d                # เปิดทุก service
docker compose down                 # ปิดทุก service
docker compose logs -f              # ดู logs แบบ realtime

สรุป

Docker เปลี่ยนวิธี deploy software ไปตลอดกาล — จาก "ติดตั้งทีละเครื่อง ลุ้นว่าจะรันได้ไหม" เป็น "build once, run anywhere" ทุก cloud provider, CI/CD pipeline, microservice architecture ล้วนใช้ containers เป็นพื้นฐาน เรียนรู้ Docker เป็น skill แรกๆ ที่ DevOps ต้องมี:

  • VM = จำลองเครื่องทั้งเครื่อง (มี Guest OS) → หนัก แต่ isolation สูง
  • Container = จำลองแค่ environment (แชร์ kernel) → เบา เร็ว portable
  • Dockerfile → Image → Container (สูตร → แผ่น CD → เครื่องเล่น)
  • Docker Compose = รันหลาย container พร้อมกันด้วยไฟล์เดียว
  • ในโลกจริง ใช้ทั้งคู่ — VM เป็น infrastructure, Container รัน app
  • Docker แก้ปัญหา "It works on my machine" ได้จริง 🐳

ในโพสต์หน้าเราจะมาพูดถึง API Request Lifecycle — เวลากด send request ไป server มันเกิดอะไรขึ้นบ้าง? 🌐🐕

In the previous post we talked about the CI/CD pipeline and how it lets us build, test and deploy automatically.

But have you ever hit this? "It works on my machine, but it breaks on the server." 🤦

The cause is a difference in environment — different OS versions, different libraries, different config — so code that runs happily on your machine falls over on someone else's.

The fix is to make every environment the same, and there are two main ways to do it:

  1. Virtual Machines (VMs) — simulate an entire computer
  2. Docker Containers — simulate only what the app needs

Let's look at what each one is, how they differ, and when to reach for which.


What Is a Virtual Machine (VM)?

A VM (Virtual Machine) is an entire computer simulated in software — it has a virtual CPU, RAM, disk and network, and it runs on a real machine (the Host) through a Hypervisor that allocates resources to each VM. Think of dividing an apartment building into rooms: every VM is independent, each can run a different OS, and if one VM crashes it does not touch the others.

Host Machine
Hypervisor
VM 1
App
Libs
Guest OS
VM 2
App
Libs
Guest OS
Host OS
Hardware

Notice that each VM carries its own Guest OS, which means:

  • ✅ Complete separation (isolation is very strong)
  • ✅ Different operating systems can run side by side (Windows on a Linux host)
  • ❌ But it eats a lot of RAM, CPU and disk
  • ❌ Slow to start (a whole OS has to boot)

Popular hypervisors:

  • Type 1 (Bare-metal): VMware ESXi, Hyper-V, Proxmox — run directly on the hardware
  • Type 2 (Hosted): VirtualBox, VMware Workstation — run on top of an existing OS

What Is a Docker Container?

A container simulates only the environment the app needs — no whole OS required! A container shares the kernel with the Host OS and then uses Linux features (namespaces, cgroups) to separate each container's processes, filesystem and network. The result: very light (MB instead of GB), very fast (starts in seconds instead of minutes), and portable (it runs anywhere Docker runs).

Host Machine
Container 1
App
Libs
Container 2
App
Libs
Container 3
App
Libs
Docker Engine
Host OS
Hardware

Notice that there is no Guest OS — containers share the Host OS kernel, which means:

  • ✅ Very light (MB vs GB)
  • ✅ Very fast to start (seconds vs minutes)
  • ✅ Many containers can run at the same time
  • ❌ They must share the same Linux kernel (on Mac/Windows a small VM is hidden underneath)
  • ❌ Weaker isolation than a VM

VM vs Container, Side by Side

The table below compares VMs and containers across every dimension — notice that containers are faster, lighter and easier to scale on almost every count, but VMs still hold two advantages: stronger isolation (separate kernels) and support for a different OS (running Windows on a Linux host, for instance):

Virtual MachineDocker Container
SizeSeveral GB (a full OS)A few MB — a few hundred MB
Start-up timeMinutes (an OS boot)Seconds
PerformanceHypervisor overheadClose to native
IsolationVery high (separate OS)Moderate (shared kernel)
How many you can run5-20 per machine100+ per machine
Different OS possibleYes (Windows on Linux)No (needs the Linux kernel)
RAM usageReserves the whole blockUses only what it needs
PortabilityHard to move (huge files)Easy to move (small images)

How Does Docker Work?

Docker runs on a client-server architecture — the Docker CLI (the client) sends commands to the Docker Engine (the daemon), which manages images and containers. There are three core concepts to understand, and the OOP analogy is a good one: Dockerfile = source code, Image = class, Container = object:

1. Dockerfile — the Recipe for an Image

A Dockerfile is a text file that says, step by step, how to prepare the environment — start from a base image (Node.js 20, say), copy the source code in, install the dependencies, declare the port, and define the command to run at start-up. It is like a cooking recipe: follow the steps and you get the same result every time:

# start from a base image
FROM node:20-alpine

# set the working directory
WORKDIR /app

# copy package.json, then install dependencies
COPY package*.json ./
RUN npm ci --production

# copy the source code
COPY . .

# declare which port the app uses
EXPOSE 3000

# the command that runs the app
CMD ["node", "server.js"]

2. Image — What the Dockerfile Produces

An image is a snapshot of an environment that is ready to run — the result of a docker build on a Dockerfile. The image holds everything the app needs (OS libs, runtime, code, configs) and can be shared through Docker Hub or a private registry. It is like a burned CD — copy it and run it anywhere:

# build an image from the Dockerfile
docker build -t my-app:v1 .

# list all images
docker images

An image is read-only — just like a class in OOP.

3. Container — the Instance Running From an Image

A container is an image that is actually running — created with docker run. One image can produce many containers, each with its own filesystem, network and process space. It is the object you new from a class in OOP:

# run a container from an image
docker run -d -p 3000:3000 --name my-app my-app:v1

# list the running containers
docker ps

# stop / remove a container
docker stop my-app
docker rm my-app

The relationship:

Dockerfile
the recipe
→ build →
Image
the CD
→ run →
Container
the player

A Real Example: Deploying a Web App

Let's compare the real steps for deploying a web app the VM way (the old way) and the Docker way (the new way) — you will see how much Docker cuts out, and, more importantly, that everyone gets the same environment. No more "but it runs on my machine":

The VM Way (the Old Way)

SSH into the server, install the OS, install the dependencies one by one, configure everything by hand — and if you have 10 servers you repeat it 10 times. Forget a step and it breaks:

# 1. create a new VM
# 2. install Ubuntu
# 3. install Node.js
sudo apt update
sudo apt install nodejs npm

# 4. copy the code to the VM
scp -r ./my-app user@vm-ip:/home/user/

# 5. install dependencies
cd /home/user/my-app && npm install

# 6. run the app
node server.js

# time taken: 15-30 minutes 😩
# with 3 servers = do it 3 times 😩😩😩

The Docker Way

Write the Dockerfile once, then docker build + docker run and you are done — dev, staging and production all get exactly the same environment. Deploying to 10 servers is just docker run ten times (or let K8s handle it for you):

# 1. build the image (once)
docker build -t my-app:v1 .

# 2. run it (anywhere)
docker run -d -p 3000:3000 my-app:v1

# time taken: 1-2 minutes 🎉
# with 3 servers = docker run 3 times 🎉🎉🎉

Docker Compose — Running Several Containers at Once

A real app is never a single container — there is a web server + database + cache + message queue + ... Running docker run one at a time, wiring up the network yourself, setting up the volumes yourself, gets messy fast! Docker Compose solves this by declaring every service in one YAML file and starting them all with a single docker compose up:

# docker-compose.yml
version: '3.8'

services:
  web:
    build: .
    ports:
      - "3000:3000"
    environment:
      - DATABASE_URL=postgres://db:5432/myapp
    depends_on:
      - db
      - redis

  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: myapp
      POSTGRES_PASSWORD: secret
    volumes:
      - pgdata:/var/lib/postgresql/data

  redis:
    image: redis:7-alpine

volumes:
  pgdata:
# bring every service up together
docker compose up -d

# take every service down
docker compose down

One command, and web + database + cache are all running ✅


So When Should You Use Which?

Most of the time the answer is Docker — but there are use cases where a VM is still necessary:

Use a Docker container when:

  • 🐳 You want to deploy an app quickly
  • 🐳 You want the same environment everywhere (dev = staging = production)
  • 🐳 You need to run several microservices
  • 🐳 You are working with a CI/CD pipeline
  • 🐳 You need to scale up and down fast (Kubernetes)

Use a VM when:

  • 🖥️ You need to run a different OS (a Windows app on a Linux host)
  • 🖥️ You need very strong security isolation (multi-tenant, compliance)
  • 🖥️ You are running a legacy app that requires a specific OS
  • 🖥️ You need full control of the OS (kernel tuning, custom drivers)

Use both:

Large organizations usually run both: VMs as the infrastructure layer + containers running on top of the VMs

Cloud providers (AWS, GCP, Azure) use VMs as the backend and then let us run containers on those VMs.

Kubernetes — Pod · Pod · Pod ← Containers
VM (EC2) ← Virtual Machine
Physical Server ← Hardware

The Docker Commands You'll Actually Use — A Summary

These are the Docker commands DevOps engineers use every day — you don't have to memorise them all, just know they exist and reach for docker --help when you need it. The ones you will use most are docker build, docker run, docker ps and docker logs:

# === Images ===
docker build -t app:v1 .           # build an image
docker images                       # list all images
docker pull nginx:latest            # pull an image from Docker Hub
docker rmi app:v1                   # remove an image

# === Containers ===
docker run -d -p 8080:80 nginx     # run a container
docker ps                           # list running containers
docker ps -a                        # list all of them (including stopped)
docker stop <container_id>          # stop
docker rm <container_id>            # remove
docker logs <container_id>          # view the logs
docker exec -it <id> /bin/sh        # get a shell inside the container

# === Docker Compose ===
docker compose up -d                # bring every service up
docker compose down                 # take every service down
docker compose logs -f              # follow the logs in real time

Summary

Docker changed how software is deployed for good — from "install it machine by machine and hope it runs" to "build once, run anywhere". Every cloud provider, every CI/CD pipeline, every microservice architecture rests on containers. Learning Docker is one of the first skills a DevOps engineer needs:

  • VM = a whole simulated machine (with a Guest OS) → heavy, but high isolation
  • Container = only the environment is simulated (kernel shared) → light, fast, portable
  • Dockerfile → Image → Container (recipe → CD → player)
  • Docker Compose = several containers running together from a single file
  • In the real world you use both — VMs as infrastructure, containers running the app
  • Docker really does solve "It works on my machine" 🐳

In the next post we will talk about the API Request Lifecycle — when you hit send on a request to a server, what actually happens? 🌐🐕

บทความจากซีรีส์ DevOps & Vibe Coding 2026A post from the DevOps & Vibe Coding 2026 series
← Previous
CI/CD Pipeline — ส่ง Code ขึ้น Production แบบอัตโนมัติ
Next →
API Request Lifecycle — เมื่อกด Send เกิดอะไรขึ้นบ้าง?