EngineeringSenior DeveloperTraining Sessions

Session 13 - API Design: Thiết Kế API Mà Consumer Muốn Dùng

Premium

Nhiều dev thiết kế API "dựa trên database schema" - mỗi table = 1 endpoint, mỗi column = 1 field. Kết quả: API khó dùng, N+1 ở client side, và consumer ghét bạn.


Mục tiêu

  • Thiết kế API từ góc nhìn consumer (không phải database)
  • RESTful đúng nghĩa (không chỉ CRUD mapping)
  • Error responses chuẩn (ProblemDetails)
  • Versioning strategy thực chiến

1) Thiết Kế Từ Consumer, Không Từ Database

csharp
// ❌ Database-driven API: mỗi table = 1 endpoint
GET /api/orders/123           → { orderId, customerId, total, status }
Premium

Continue with premium access

Session 13 - API Design: Thiết Kế API Mà Consumer Muốn Dùng is part of the premium library. Sign in with a premium account to unlock the full lesson and the rest of this track.

01 Full premium lesson access
02 Deeper implementation notes
03 Ongoing content updates