設計一個好的 ETL pipeline
- 骯髒的 raw input 必須處理乾淨,呈現一個乾淨的 view 讓所有用戶使用。這個處理包含各式各樣的 data validation or repair (if repairable). 被歸類為無法修復的 records 必須另外存放,另作調查。
- T (Transform) 的算法,是不是確定性 deterministic 的?是的話,怎麼驗證。不是的話,用戶可以接受嗎?一個常見的錯誤是 Java comparator 不夠 exhaustive 導致排序結果有不確定性 not deterministic。
- T (Transform) 的算法,會不會影響浮點數的精準度?是的話,怎麼應付,不是的話,怎麼驗證?
- Mission Critical 的演算法,最好能 measure all code path,譬如說 Hadoop Counters。Apache Spark 的 accumulators 只有在 actions 能保證被更新一次,是個先天的缺陷。
- 怎麼樣的 De-duplication 合理?怎樣的 de-dup window 合理?最終能不能 streaming de-dup?
- Output 選擇好的 partitions,例如 時間 / Property Type / 空間。
- 演算法的實作,最好跟 execution framework 無關。
- Do all your code paths follow the contracts? (Output is de-duplicated; sorted; anonymized, privacy … etc)。特別是當你/妳選擇 pass through 一些 records,這些 records 應不應該 follow the contracts? 我覺得是應該。
- 注意編碼,尤其要注意 partition key fields 如果可能會有不同的編碼 (e.g. not UTF-8),要格外慎重。