🌐 第一節:Application Layer 是什麼?
✅ 概念:
- Application Layer 是 Internet 模型(五層模型)的最上層(第 5 層)
- 它是讓使用者可以與網路互動、完成任務的軟體層級,比如瀏覽網頁、收發 Email、FTP 等。
📶 Internet 五層模型回顧:
[5] 應用層(Application Layer)🧑💻:瀏覽器、Email、FTP
[4] 傳輸層(Transport Layer)🚚:TCP / UDP
[3] 網路層(Network Layer)🧭:IP
[2] 資料鏈結層(Data Link Layer)🔗:Ethernet, Wi-Fi
[1] 實體層(Physical Layer)🔌:實體傳輸(電線、光纖)
🏗️ 第二節:Application Architecture(應用架構)
✅ 四大功能模組(Function Modules):
- Presentation Logic:資料顯示與輸入(UI/UX)
- Application Logic:業務邏輯(例如:表單送出、計算邏輯)
- Data Access Logic:與資料庫溝通的邏輯
- Data Storage:實際資料儲存(DB)
🖥️ 第三節:應用架構類型(Application Architecture Types)
1. Host-Based Architecture(主機型架構)
- 所有邏輯都在伺服器端,Client 端只是終端機
- 常見於舊式大型主機(Mainframe)與終端機架構
優點:
缺點:
2. Client-Based Architecture(客戶端型)
- 使用者端(Client)擁有 Presentation、Application、Data Access
- Server 端只提供 Data Storage(資料庫)
優點:
缺點:
- 每次資料都要在 Client 與 Server 間傳輸,增加網路流量
3. Client-Server Architecture(分工架構)
- 業界主流架構,Client 與 Server 分別負責不同邏輯
- Client:Presentation + Application(有些也做 Data Access)
- Server:Data Access + Data Storage
可分:
- Thick Client:Client 負責較多邏輯
- Thin Client:Client 只做 UI,邏輯全在伺服器
優點:
- 分散效能壓力,可混用不同平台
- 易擴充、減少頻寬使用
缺點:
4. Tiered Architectures(多層架構)
- 依功能拆分出兩層(2-tier)、三層(3-tier)、甚至多層(n-tier)
例如:
- 三層架構:
- Client:Presentation Logic
- App Server:Application Logic
- DB Server:Data Access + Storage
優點:
缺點:
5. Peer-to-Peer Architecture(點對點架構)
- 每台設備都可同時扮演 Client 與 Server,例如 BitTorrent
優點:
缺點:
6. Cloud Computing(雲端運算)
模型分類:
模型 |
用戶管理 |
供應商管理 |
例子 |
IaaS |
OS與應用 |
基礎設施(硬體) |
AWS EC2 |
PaaS |
應用 |
OS + DB + 硬體 |
Azure |
SaaS |
幾乎無需管理 |
所有層 |
Google Workspace, Salesforce |