# MapReduce ## 簡介 由於CPU性能上的瓶頸,加上資料量的快速增加,人們開始借助於分散式程式設計來提高程式性能,透過並行的方式獲得大量的計算能力,得以處理大規模資料任務 MapReduce為Google於2004年提出的分散式並行程式設計模型,主要依靠Map和Reduce兩個函數,Map將資料切割成不相關的區塊,分給其他電腦運算,再用Reduce將運算結果彙整 由於移動資料需要大量的網路傳輸成本,所以MapReduce的設計理念為「計算向資料靠攏」,而非「資料向計算靠攏」 與Federated Learning不同的地方主要在於隱私方面,MapReduce須將資料做分割去做計算,而Federated Learning則因為隱私的關係,所以資料會留在客戶端上 ## 流程  1. input : 輸入的資料 2. split : 將input分成多個splits 3. map : 產生(key,value) 4. shuffle : 根據key可去作排序或結合等工作 5. reduce : 將shuffle後的資料彙總 6. output : 輸出最終結果 ## 例子  - 以Word Count為例 1. input : 輸入一串單字,此處共有5種字母(A、B、C、D、E) 2. split : 將input依照每列分成多個splits 3. map : 在各自的splits中,會對splits內的每個單字產生出(key,value),key為單字類別,value為數量 4. shuffle : 根據key,將相同的單字作結合 5. reduce : 將結合後的單字數量作彙整 6. output : 輸出各個單字的數量
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up