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

Spacer - iThome Serverless All-Star

94575b73a05d48e567423d7d6ca8273c?s=47 Poga Po
March 29, 2018

Spacer - iThome Serverless All-Star

94575b73a05d48e567423d7d6ca8273c?s=128

Poga Po

March 29, 2018
Tweet

More Decks by Poga Po

Other Decks in Technology

Transcript

  1. Poga. 2018.03.29

  2. Serverless • 以 function 為執行單位 • 按照每個 function 使用的資 源量計費

  3. Hello World (Lua) function (args) return "Hello from Spacer!" end

    Code
  4. Calling Other Functions -- by name local flow = require

    "flow" flow.call("foo") Code
  5. Calling Other Functions -- by require local foo = require

    "foo" foo() Code
  6. Expose Function as Public JSON API with Lua local Gateway

    = { -- HTTP Method, Path, Function {"GET", "/hello", "hello"} } Code
  7. Spacer • 流暢的開發體驗:Optimized for programmer happiness • 極低的架設門檻:不依賴 kubernetes、container、VM ◦

    Minimal Dependency: nginx & PostgreSQL • Why? Nginx & Lua Code
  8. Serverless is Hard Architecture

  9. “Just a function” - Container • Programming languages • Sandbox

    • Performance ◦ Inter-function communication、RPC ◦ Cold Start Architecture
  10. “Just a function” - Scheduling • Manage container images •

    Load/Unload containers • Event-Trigger • Kubernetes? Architecture
  11. How Spacer Work • Lua • Nginx (openresty) • Kappa

    Architecture Architecture
  12. • Since 1993 • Embeddable Script Language • Lightweight Sandboxed

    Lua VM • High-performance (LuaJIT): ◦ Game Engine ◦ CDN ◦ CERN ◦ Super Computers Architecture
  13. • Common Gateway Interface (1993) • Openresty ◦ (nginx +

    LuaJIT) ◦ Schedule Lua VM with nginx workers Architecture
  14. Kappa Architecture “Where everything is a stream” • A software

    architecture pattern • Append-only immutable event log • Real-time, Streaming Architecture
  15. Spacer: Simple, Solid, Proven Technologies Serverless frameworks Spacer Sandbox/Package Container

    Lua Scheduling Kubernetes nginx(openresty) Event ? Kappa architecture Architecture
  16. Spacer is Platform Agnostic Architecture

  17. But Why Serverless? philosophy

  18. 「好程式」 • 容易擴充、容易維護的架構 • 永遠是第一個被犧牲 • 「我們另外安排時間重構」- 主管,永遠不會實現 • 開發越來越慢、開發者心情越來越差、產品更新速度大減

    ◦ 最後失敗 philosophy
  19. 「好程式」 • 軟體架構的價值太難量化 • 對非專業人士來說太難理解 philosophy

  20. 「好程式」in serverless • 軟體架構 = 營運成本 • 重構 = Cost

    Down • 開發者得到更多優化的空間 philosophy
  21. 看不懂軟體架構,也看的懂帳單的金額 philosophy

  22. 「好產品」 • 軟體開發: ◦ 定 Spec、定時程 ◦ 難以專注在用戶需求上 • 「從一條

    SQL 到上線的距離有多遠?」 philosophy
  23. 「好產品」in Serverless • 不用分心在架構與技術細節上 ◦ 產品上線速度更快 • 更精細的產品分析: ◦ 一個

    User 進來後,平均搜尋了幾次,花了多少成本? ◦ 一個 User 平均帶來的收入是? ◦ 優化: ▪ 流量? ▪ Function 效能? ▪ 轉換率? philosophy
  24. 「開發費用」 • 報價 10 萬跟 100 萬的差別在哪? • 維護費? •

    Serverless ◦ 成本透明,按照用量收費 ◦ 開發者與客戶目標一致:提高產品價值 philosophy
  25. Spacer: Simplified Serverless philosophy

  26. Serverless: From Engineering to Utility philosophy

  27. Thanks! github.com/poga/spacer