Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Enable Resiliency and Efficiency at LINE Invoice

Enable Resiliency and Efficiency at LINE Invoice

活動:LINE Developers Meetup 開發者小聚 #18 - TECH FRESH 畢業展
活動頁面:https://linegroup.kktix.cc/events/20230627-tech-fresh-gratudation
講者:Matt Chang, Steve Yu

LINE Developers Taiwan

July 02, 2023
Tweet

More Decks by LINE Developers Taiwan

Other Decks in Technology

Transcript

  1. • Introduce LINE Invoice • Share my intern experience •

    Share some tech knowledge • Mainly focus on Backend. Introduction
  2. Backend: CRUD Boy • CRUD (Create, Read, Update, Delete) •

    Example: TODO List • What's CRUD Boy?
  3. Backend: CRUD on Distributed System • CRUD on Distributed System

    • 寫的 code 變成跑在多台 server 上 • 不同 server 間彼此需要緊密溝通 • 需要考慮的事情變多 • Race condition • Unreliable connection
  4. Resilliency and Efficiency • Resilliency • Infra: • E.g. self-healing,

    rolling upgrade • Backend: • E.g. Retry, Timeout and Rate Limit • Efficiency: • Infra: • Vertical Scaling • Horizontal Scaling • Backend: • E.g. Time complexity, concurrent/multithread programming, System Design
  5. Resilliency: Unreliable connection • Be careful with Input & Output.

    • Retry: • What happened when requested service is temporarily unavailable? • Timeout: • What happened when requested service is unresponsive? • Rate limit: • In-bound: Restrict others from accessing service too frequently. • Out-bound: Restrict request frequency to other service.
  6. Efficiency: System Design • Usage of Cache and Why ?

    • Memory access is faster than disk. • No need to do complex computation again. • Real world example: Human Brain • In-memory cache Problem • Cache stored in server S1 can't be accessed by server S2. • Try In-memory database • E.g. Redis
  7. Short Summary • CRUD / CRUD in distributed System •

    Resiilliency • Retry / Timeout / Rate Limiting • Efficiency • Concurrent programming • System Design: Cache
  8. SteveYi Yu Site Reliability Engineering Intern @ LINE 12 •

    Service maintenance (k8s) • Deployment (containerization & YAML) • Monitoring (Grafana)
  9. 簡單來說就是 CI/CD 一條龍 Alert & Monitor 13 CI/CD Docker-compose /

    containerization & ArgoCD • CI/CD ◦ 自動化 build 成 Image ◦ 上傳到內部的 Docker Registry • ArgoCD ◦ 以自動規模化 (Auto Scale) 的方 式部署 • Alert & Monitor ◦ Grafana 上查看視 覺化面板 ◦ 異常情況發送通 知到 Slack
  10. Deploy to ArgoCD 15 • Build to Docker Image •

    Upload to Harbor (Internal Image Registry) • Update k8s Deploy YAML
  11. How LINE Invoice Work? 17 • Kubernetes ◦ 根據流量自動擴展 Pod

    ◦ rolling update 會將流量分散 ,不影響用戶訪問