惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
IT之家
IT之家
博客园_首页
博客园 - 【当耐特】
V
V2EX
Apple Machine Learning Research
Apple Machine Learning Research
G
Google Developers Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
GbyAI
GbyAI
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
H
Help Net Security
T
Tailwind CSS Blog
B
Blog RSS Feed
Martin Fowler
Martin Fowler
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
博客园 - 叶小钗
雷峰网
雷峰网
量子位

hwchiu learning note Blog

Kubernetes 怎麼計算 imageFS | hwchiu learning note Nginx Proxy_Pass 不會重新查詢 DNS | hwchiu learning note Multus 下如何透過 network policy 設定 | hwchiu learning note Linux Bridge MTU | hwchiu learning note Kubevirt 初體驗 | hwchiu learning note [MacOS ]隨手筆記 Sed 與 Rename 的使用 | hwchiu learning note Docusaurus 使用 blog mode 後連結一直反白的問題 | hwchiu learning note gcloud 切換帳號 | hwchiu learning note k8s 內安裝 redis-cluster | hwchiu learning note Helm Chart 中如何根據條件來動態安裝 Template 內的物件 | hwchiu learning note GCS 操作上注意事項 | hwchiu learning note istio 操作記錄 | hwchiu learning note terraform | hwchiu learning note Kubernetes GKE 維運上小筆記 | hwchiu learning note Git 修改 author/committer | hwchiu learning note GCP NAT 相關筆記 | hwchiu learning note gcloud ssh 到 GCP VM | hwchiu learning note CloudSQL 收費注意事項 | hwchiu learning note Loki 安裝上的參數調整以及 Ring 的問題除錯 | hwchiu learning note kustomize + helm | hwchiu learning note 觀測 K8s 內 OOM 事件 | hwchiu learning note GKE 上的 RBAC 筆記 | hwchiu learning note 本地產生 jwt token | hwchiu learning note ArgoCD 安裝筆記 | hwchiu learning note CircleCI Context 的使用 | hwchiu learning note 透過 GCP IAP Gateway 來保護 GKE 內的網站 | hwchiu learning note 閱讀筆記: 「SRE 的工作介绍」 | hwchiu learning note 閱讀筆記: 「DevOps is a failure」 | hwchiu learning note 閱讀筆記: 「Cloudflare 06/21 災後報告」 | hwchiu learning note 閱讀筆記: 「啟動 container 直接 kernel panic 的 bug」 | hwchiu learning note
閱讀筆記: 「面試人生 - 設計一個簡易的分散式 Job Scheduler...
HungWei ChiuBlogger · 2022-06-27 · via hwchiu learning note Blog

標題: 「面試人生 - 設計一個簡易的分散式 Job Scheduler」 類別: others 連結: https://medium.com/@raxshah/system-design-design-a-distributed-job-scheduler-kiss-interview-series-753107c0104c

本篇文章是一個面試技術文,探討開發一個類似 Job Scheduler 的專案時應該要如何去設計整體系統來完成需求,整體的架構基於 KISS 的原則,就是簡單為主。

整個流程原則基本上是

  1. 理解所有功能需求,包含功能面以及非功能面
  2. 瞭解可能的資料,根據規模大小與功能需求去推估出整體的規模大小
  3. 根據上述需求去規劃整體架構,其中規模大小有時候可以幫忙歸納出 ”讀寫“彼此的比例,這個會影響架構設計

功能面常見類型如

  1. 針對使用者提供何種操作,譬如遞交一個 Job, 列出所有 Job(當前,歷史)
  2. 每個 Job 的運行時間限制(ex, 5min),同時 Job 可以重複運行或是只運行一次等不同用法
  3. Job 本身也有優先度的設計,可以插隊等

非直接功能面如

  1. 可動態擴充規模來支援不同量級的需求
  2. 不論發生任何錯誤問題,使用者提交過的 Job 資訊都不能遺失
  3. 非同步設計,使用者遞交 Job 後就可以繼續別的工作, Job 完成後會主動通知使用者

有了功能面的需求,接下來就是數量大小的需求,譬如該架構要可以達到每秒 1000 個 Job(1000QPS), 從這些需求下去估算大概需要多少 CPU 以及多少 Memory,同時這些數量還可以滿足功能面的需求,譬如每個 Job 可以運行最多五分鐘。

所以也許會得到需要 10,000 台的 (16C) 機器,以及 100 台(16GB) 的機器來提供服務 基本的運算可以快速的理解該需求到底需不需要分散式的架構來處理,本文的範例資料量就很明顯是 scale up 沒有辦法完成的。

接下來就基於分散式的架構去設計相關架構,包含如

  1. Load Balancer
  2. Backend
  3. DB
  4. Job scheduler
  5. Job Executor
  6. Queue
  7. File system

逐步的規劃這些架構,並且探討彼此元件之間的溝通方式,這些方式是如何互相組合來滿足功能面/非功能面的需求

詳細需求可以參考全文