0Pricing
gRPC & High Performance APIs · บทเรียน

การจัดการทราฟฟิก gRPC ด้วยโครงข่ายบริการ

ใช้โครงข่ายบริการอย่าง Istio เพื่อจัดการทราฟฟิก gRPC บนคลาวด์ด้วยพร็อกซีข้างบริการ การกำหนดเส้นทางอัจฉริยะ การลองใหม่ และการเปิดตัวแบบคานารี

การจัดการทราฟฟิก gRPC ด้วยโครงข่ายบริการ เป็นบทเรียน gRPC & High Performance APIs ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน gRPC & High Performance APIs และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส gRPC & High Performance APIs มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

Why a Service Mesh

As gRPC microservices multiply, cross-cutting concerns — routing, retries, mTLS, observability — clutter every service. A service mesh moves these into the platform layer.

The Sidecar Proxy

A mesh injects a sidecar proxy (e.g. Envoy) next to each pod. All gRPC traffic flows through it, so the proxy can apply policy without changing app code.

Data Plane vs Control Plane

Two halves:

  • Data plane: the proxies that move traffic
  • Control plane: configures the proxies (Istiod in Istio)

You write high-level rules; the control plane programs each proxy.

gRPC-Aware Load Balancing

Plain L4 load balancers pin all streams of a connection to one backend, unbalancing gRPC. The mesh proxy is L7 and balances per-request, spreading RPCs evenly.

Defining a VirtualService

An Istio VirtualService routes traffic by rules — host, headers, or weights. Here all traffic goes to the v1 subset.

spec:
  hosts: ['orders']
  http:
  - route:
    - destination: { host: orders, subset: v1 }

Canary Releases by Weight

Split traffic by percentage to roll out a new version gradually and watch its error rate before shifting more.

route:
- destination: { host: orders, subset: v1 }
  weight: 90
- destination: { host: orders, subset: v2 }
  weight: 10

Automatic Retries

The mesh can retry failed RPCs without app code. Configure attempts and per-try timeout, and limit retries to safe (idempotent) methods.

retries:
  attempts: 3
  perTryTimeout: 2s
  retryOn: 'unavailable'

Timeouts and Circuit Breaking

Set request timeouts and outlier detection so unhealthy backends are ejected automatically, protecting the system from cascading failures.

outlierDetection:
  consecutive5xxErrors: 5
  interval: 30s

Built-in mTLS

The mesh issues and rotates certificates, encrypting all service-to-service gRPC with mutual TLS automatically — no app changes required.

Observability for Free

Because all traffic passes through proxies, the mesh emits metrics, distributed traces, and access logs for every gRPC call, feeding dashboards like Kiali and Grafana.

Trade-offs

Meshes add value but also cost:

  • Extra latency per hop via the sidecar
  • Higher resource usage
  • Operational complexity

Adopt when service count and policy needs justify it.

Quick Check

Test your mesh knowledge.

Recap

You learned mesh traffic management:

  • Sidecar proxies apply policy without app changes
  • L7 proxies load-balance gRPC per request
  • VirtualService rules enable canary releases by weight
  • Built-in retries, timeouts, circuit breaking, and mTLS
  • Free observability — at the cost of latency and complexity

คำถามที่พบบ่อย

บทเรียน “การจัดการทราฟฟิก gRPC ด้วยโครงข่ายบริการ” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “การจัดการทราฟฟิก gRPC ด้วยโครงข่ายบริการ” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส gRPC & High Performance APIs ให้อัปเกรดเป็น CoddyKit PRO คอร์ส gRPC & High Performance APIs มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “การจัดการทราฟฟิก gRPC ด้วยโครงข่ายบริการ”

ใช้โครงข่ายบริการอย่าง Istio เพื่อจัดการทราฟฟิก gRPC บนคลาวด์ด้วยพร็อกซีข้างบริการ การกำหนดเส้นทางอัจฉริยะ การลองใหม่ และการเปิดตัวแบบคานารี คุณปฏิบัติ gRPC & High Performance APIs ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน gRPC & High Performance APIs หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน gRPC & High Performance APIs บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน

บทเรียน “การจัดการทราฟฟิก gRPC ด้วยโครงข่ายบริการ” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน gRPC & High Performance APIs นี้ได้ไหม

ได้ บทเรียน gRPC & High Performance APIs ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. gRPC บน Kubernetes
  2. ตัวจัดสมดุลภาระงานบนคลาวด์
  3. ฟังก์ชัน gRPC แบบไร้เซิร์ฟเวอร์
  4. การจัดการทราฟฟิก gRPC ด้วยโครงข่ายบริการ
← กลับไปที่ gRPC & High Performance APIs