Flink+Hologres助力伊的家電商平臺建設新一代實時數倉

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"廣州伊的家網絡科技有限公司是一家專注於服務女性的B2B2C電商平臺,業務範圍包括護膚、彩妝、營養美容食品、私人定製服裝、跨境電商等領域。自2008年孵化項目,2011年5月上線天貓商城,全國8大配送中心,妍詩美、妍膳等品牌陸續成立,並於2013年上線了伊的家自主電商平臺,2020年全面啓動品牌升級。伊的家以互聯網主動式服務營銷,打造護膚老師與客戶強連接關係,從上到下嚴格貫徹以品質及專業爲基礎,以社交信任做連接,以服務獲得認可的經營思路,經過持續的創新和積累,成爲社交電商翹楚。","attrs":{}}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"業務場景與痛點分析","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"伊的家是一家集開發、設計、運營、銷售於一體一個B2B2B的電商平臺,服務百萬級會員之外,還同時支持上千級別經銷商和代理商,業務應用多、數據量大、數據查詢併發要求高。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"伊的家技術部門在近3年經歷了高速發展,在發展過程中,始終堅持業務優先,爲此也進行了應用整合、拆分微服務、聚合分佈式應用的多種技術升級改造,目前整個部門現狀分析如下:","attrs":{}}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"架構方面:","attrs":{}},{"type":"text","text":"多語言、多數據源、技術升級的業務入侵問題明顯;","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"數據方面:","attrs":{}},{"type":"text","text":"應用拆分引發的數據孤島問題,繼而造成大量的數據複製、重新建設問題;","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"應用方面:","attrs":{}},{"type":"text","text":"從業績的角度出發,業務方希望及時準確地看見業績數據,對實時性有了較高需求;","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"效率方面:","attrs":{}},{"type":"text","text":"體系化的流程與工具訴求愈發強烈;","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"成本方面:","attrs":{}},{"type":"text","text":"主要問題是既懂大數據又懂業務的人才招聘難,團隊建設成本高","attrs":{}}]}]}],"attrs":{}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/1a/1adc30b616ae3aa811a549b26158bcdb.png","alt":"伊1.png","title":"伊1.png","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"伊的家近幾年業務高速增長,數據量激增,業務複雜度也隨之增大,解決在當前大數據架構之下,“人才儲備難”、“業務升級受限於已有技術”、“雙11活動壓力大”等痛點問題已迫在眉睫。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/8c/8c67b3bfff8ddd644ab098a7f1835422.png","alt":"伊2.png","title":"伊2.png","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"產品選型","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"伊的家技術部門對於技術升級改造的需求有非常明確清晰的定義,","attrs":{}},{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"主要圍繞關存儲彈性擴縮容、查詢性能優化、OLAP、學習成本、查詢響應、可擴展等角度進行展開","attrs":{}},{"type":"text","text":",核心關注以下3個問題:","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"1)如何快速完成數據清洗","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"2)如何快速精準完成數據校驗","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"3)如何快速進行故障恢復處理","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/96/962ab924e8e7ced81047410eff2b73bc.png","alt":"伊3.png","title":"伊3.png","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在技術選型時始終堅持“技術選型是第一生產力”的原則,堅信技術儲備沒有最好只有更好,堅信技術選型是決定能力差異化所在,堅持提高一次性把事情做對的能力,堅信開放分享、認知升級的重要性。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/e3/e33df540c673d2875ae54100b9f1c277.png","alt":"伊4.png","title":"伊4.png","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"早期耶基於Hadoop、HBase、Kafaka、Azkaban、Spark、Greenplum等開源大數據產品進行了許多摸索嘗試,通過性能對比最終採用了Greenplum,但最終發現Greenplum併發能力差,只適合分析場景,並不適合高併發的查詢服務。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"後來,在阿里雲大數據計算平臺團隊的建議下,伊的家技術部進行了全面架構升級,","attrs":{}},{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"整個架構由DataWorks、實時計算Flink和Hologres組成,架構簡單、學習成本非常低,僅通過SQL即可輕鬆跑通全鏈路","attrs":{}},{"type":"text","text":"。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"下面將會給大家介紹,阿里雲技術產品在伊的家落地的場景最佳實踐","attrs":{}}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"最佳實踐","attrs":{}}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"一、客戶系統實踐","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"伊的家原客戶關係管理系統(CRM)主要基於MySQL、MQ、Canal以及自研應用組成,爲支持業務系統切斷式升級,技術部門自主研發了一套消息中間件,維護成本較高;基於Binlog、MQ、OLAP等產品自定義的數據開發流程過程繁瑣複雜、維護成本極高,且因爲系統要求數據有序對清洗的併發產生了一定的限制。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/5d/5d38193577b1f12b970a9568f8a88d89.png","alt":"伊5.png","title":"伊5.png","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"基於Hologres+DataWorks+實時計算Flink進行架構升級後,直接通過DataWorks數據集成將數據庫數據實時寫入Hologres,然後通過實時計算Flink訂閱Hologres做進一步實時清洗,把結果表更新到數據庫,即可直接服務業務。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"整體架構清晰簡單、數據精準、端到端純實時、存儲分析一體化、託管式運維、全自動工具作業,原系統15人花了3個月才完成項目上線,當前架構僅需2天即部署完成。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/de/deecb3f1ed78fd485374f1d75b891469.png","alt":"伊6.png","title":"伊6.png","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"二、BI業績系統實踐","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"BI業績系統也可以理解爲實時GMV大屏,業務數據主要有兩方面的要求:","attrs":{}}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"實時","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"精準,業績計算絕不允許出錯。","attrs":{}}]}]}],"attrs":{}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"原架構如下圖圖所示,原始數據層通過Binlog,再經過Canal套件實時寫入MQ,之後根據業務域進行業務數據分層和清洗。任務調度系統更新業績的順序爲“日-月-季度-年”,這個看似完美的方案實際存在着幾個問題:","attrs":{}}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"實時性問題:看似實時,其實過程中可能存在5~10分鐘的延遲;","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"併發問題:消費的併發有一定限度。","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"運維問題:如果圖中的某個環節出現問題,可能會導致系統也跟着出現問題。","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"數據清洗時效問題:清洗腳本運行一次可能需要數分鐘,這期間可能會發生許多其他事情。","attrs":{}}]}]}],"attrs":{}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/f8/f8ea226a8ab2e545b5a28ba482f93b7c.png","alt":"伊7.png","title":"伊7.png","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"下圖爲升級後的BI業績系統新架構。通過DataWorks實時同步明細數據至Hologres,基於Hologres數據再增加一份實時計算Flink的實時ETL作業,即可完成“日-月-季度-年”數據的加工,最後基於Hologres對上層應用提供分析查詢服務。","attrs":{}},{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"整個系統純實時調度、實時性高、秒級延遲、全SQL開發、數據校驗高效。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/53/53ed48785b6866b328d50cb41fcaa24f.png","alt":"伊8.png","title":"伊8.png","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"三、實時應用數倉架構實踐","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"伊的家的技術部門也一直在思考如何讓應用開發人員也具備大數據開發能力,如何讓大數據不僅僅爲大數據團隊所用,還同時爲應用開發團隊所用。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"基於實時計算FLink+Hologres+DataWorks實時數倉架構的落地,提升了數據底盤的可複用性,提高了應對業務變化的數據動態調整的靈活性,與應用團隊共同構建起帶數據的應用系統。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/f8/f86e4759936ef78070e0277fbf84dc7b.png","alt":"伊9.png","title":"伊9.png","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"四、集團數倉架構實踐","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"伊的家數倉團隊服務在電商業務的同時,還需要支持集團內部業務。集團數倉平臺如市場主流數倉架構、基於開源大數據體系構建,目前也已經全面升級爲Hologres+實時計算Flink+DataWorks實時數倉架構。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/fa/fac95e74577e098e1394b3bac3084449.png","alt":"伊10.png","title":"伊10.png","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/3f/3f77e8ffd40edb8cdb3be9b5a8e90aec.png","alt":"伊11.png","title":"伊11.png","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"業務價值與賦能","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Hologres+實時計算Flink+DataWorks實時數倉新方案爲業務上帶來的價值主要如下:","attrs":{}}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"統一數據:一套方案就能支持完整流程,明細表、維度表等數據統一、有序","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"統一服務:由Hologers直接提供各種線上服務,包括數據分析,數據服務等,減少接口建設。","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"統一存儲:以Hologres爲統一存儲,多數據源都能直接寫入到Hologres,無冗餘存儲,節約成本","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"統一治理:DataWorks提供統一標準、統一作業和統一監控等,爲大數據開發平臺提供統一治理。","attrs":{}}]}]}],"attrs":{}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"從業務上來說,新的大數據方案真的做到了","attrs":{}},{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"開箱即用,所見即所得","attrs":{}},{"type":"text","text":"。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/b6/b60f26c235fef738828430ca17b7f5db.png","alt":"伊12.png","title":"伊12.png","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"展望未來","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在大數據領域,數據規模和業務複雜性是同時制約查詢性能的關鍵因素,在這個過程中,唯有我們的開發人員不斷打磨自己的數據模型,當數據模型達到一定成熟度,性能問題即可迎刃而解。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"最後,希望大家擁抱技術、擁抱變化、贏在模型,數據服務業務,數據服務應用,讓我們爲應用而生,爲應用而戰。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/2e/2e61c2c4fadb08297d312d4d6268e59f.png","alt":"伊13.png","title":"伊13.png","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/36/36e46415527c31ecdc5aaa1010a20066.png","alt":"伊14.png","title":"伊14.png","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"作者:劉松森 ,伊的家CTO,高級工程師,副教授職稱,國內多所高校客座教授","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Flink 中文學習網站:https://flink-learning.org.cn/","attrs":{}}]}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章