Modified: kylin/site/feed.xml URL: http://svn.apache.org/viewvc/kylin/site/feed.xml?rev=1891980&r1=1891979&r2=1891980&view=diff ============================================================================== --- kylin/site/feed.xml (original) +++ kylin/site/feed.xml Tue Aug 3 10:55:02 2021 @@ -19,11 +19,371 @@ <description>Apache Kylin Home</description> <link>http://kylin.apache.org/</link> <atom:link href="http://kylin.apache.org/feed.xml" rel="self" type="application/rss+xml"/> - <pubDate>Tue, 03 Aug 2021 00:39:20 -0700</pubDate> - <lastBuildDate>Tue, 03 Aug 2021 00:39:20 -0700</lastBuildDate> + <pubDate>Tue, 03 Aug 2021 03:26:40 -0700</pubDate> + <lastBuildDate>Tue, 03 Aug 2021 03:26:40 -0700</lastBuildDate> <generator>Jekyll v2.5.3</generator> <item> + <title>Kylin å¨ç¾å¢å°åºé¤é¥®çå®è·µåä¼å</title> + <description><p>ä»2016å¹´å¼å§ï¼ç¾å¢å°åºé¤é¥®ææ¯å¢éå°±å¼å§ä½¿ç¨Apache Kylinä½ä¸ºOLAP弿ï¼ä½æ¯éçä¸å¡çé«éåå±ï¼å¨æå»ºåæ¥è¯¢å±é¢é½åºç°äºæçé®é¢ãäºæ¯ï¼ææ¯å¢éä»åç解读å¼å§ï¼ç¶å对è¿ç¨è¿è¡å±å±æè§£ï¼å¹¶å¶å®äºç±ç¹åé¢ç宿½è·¯çº¿ãæ¬ææ»ç»äºä¸äºç»éªåå¿å¾ï¼å¸æè½å¤å¸®å©ä¸çæ´å¤çææ¯å¢éæé«æ°æ®çäº§åºæçã</p> + +<h2 id="section">èæ¯</h2> + +<p>éå®ä¸å¡çç¹ç¹æ¯è§æ¨¡å¤§ãé¢åå¤ãéæ±å¯ãç¾å¢å°åºé¤é¥®æå¤©éå®ç³»ç»ï¼<strong>以ä¸ç®ç§°âæå¤©â</strong>ï¼ä½ä¸ºé宿°æ®æ¯æç主è¦è½½ä½ï¼ä¸ä» æ¶åçèå´è¾å¹¿ï¼èä¸é¢ä¸´çææ¯åºæ¯ä¹é叏夿ï¼<strong>å¤ç»ç»å±çº§æ°æ®å±ç¤ºåé´æãè¶ è¿1/3çææ éè¦ç²¾åå»éï¼å³°å¼æ¥è¯¢å·²ç»è¾¾å°æ°ä¸çº§å«</strong>ï¼ãå¨è¿æ ·çä¸å¡èæ¯ä¸ï¼å»ºè®¾ç¨³å®é«æçOLAP弿ï¼åå©åæäººåå¿«éå³çï¼å·²ç»æ� �为å°é¤æå¤©çæ ¸å¿ç®æ ã</p> + +<p>Apache Kylinæ¯ä¸ä¸ªåºäºHadoopå¤§æ°æ®å¹³å°æé ç弿ºOLAP弿ï¼å®éç¨äºå¤ç»´ç«æ¹ä½é¢è®¡ç®ææ¯ï¼å©ç¨ç©ºé´æ¢æ¶é´çæ¹æ³ï¼å°æ¥è¯¢é度æåè³äºç§çº§å«ï¼æå¤§å°æé«äºæ°æ®åæçæçï¼å¹¶å¸¦æ¥äºä¾¿æ·ãçµæ´»çæ¥è¯¢åè½ãåºäºææ¯ä¸ä¸å¡å¹é åº¦ï¼æå¤©äº2016å¹´éç¨Kylinä½ä¸ºOLAPå¼æï¼æ¥ä¸æ¥çå å¹´éï¼è¿å¥ç³»ç»é«æå°æ¯æäºæä»¬çæ°æ®åæä½ç³»ã</p> + +<p>2020å¹´ï¼ç¾å¢å°é¤ä¸å¡åå±è¾å¿«ï¼æ°æ®ææ ä¹è¿ éå¢å ãåºäºKylinçè¿å¥ç³»ç»ï¼å¨æå»ºåæ¥è¯¢ä¸ååºç°äºä¸¥éçæçé®é¢ï¼ä»èå½±åå°æ°æ®çåæå³çï¼å¹¶ç»ç¨æ·ä½éªä¼å带æ¥äºå¾å¤§çé»ç¢ãææ¯å¢éç»è¿åå¹´å·¦å³çæ¶é´ï¼å¯¹Kylinè¿è¡ä¸ç³»åçä¼åè¿ä»£ï¼å æ¬ç»´åº¦è£åªã模å设计以åèµæºéé çççï¼å¸®å©éå®ä¸ç»©æ°æ®SLAä»90%æåè³99.99%ãåºäºè¿æ¬¡å®æï¼æä»¬æ²æ·äºä¸å¥æ¶µçäºâåçè §£è¯»âãâè¿ç¨æè§£âãâ宿½è·¯çº¿âçææ¯æ¹æ¡ã叿è¿äºç»éªä¸æ»ç»ï¼è½å¤å¸®å©ä¸çæ´å¤çææ¯å¢éæé«æ°æ®äº§åºä¸ä¸å¡å³ççæçã</p> + +<h2 id="section-1">é®é¢ä¸ç®æ </h2> + +<p>éå®ä½ä¸ºè¡æ¥å¹³å°ååå®¶çæ¡¥æ¢ï¼å å«éå®å°åºåçµè¯æè®¿ä¸¤ç§ä¸å¡æ¨¡å¼ï¼ä»¥æåºã人åç»ç»æ¶æé级管çï¼ææåæåéè¦æ2å¥ç»ç»å±çº§æ¥çã卿æ å£å¾ä¸è´ãæ°æ®äº§åºåæ¶çè¦æ±ä¸ï¼æä»¬ç»åKylinçé¢è®¡ç®ææ³ï¼è¿è¡äºæ°æ®çæ¶æè®¾è®¡ãå¦ä¸å¾æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-01.png" alt="" /></p> + +<p>èKylin计ç®ç»´åº¦ç»åçå ¬å¼æ¯2^Nï¼<strong>N为维度个æ°</strong>ï¼ï¼å®æ¹æä¾ç»´åº¦åªæçæ¹å¼ï¼åå°ç»´åº¦ç»å个æ°ãä½ç±äºå°é¤ä¸å¡çç¹æ®æ§ï¼åä»»å¡ä¸å¯è£åªçç»å个æ°ä»é«è¾¾1000+ãå¨éæ±è¿ä»£ä»¥å人åãæåºç»ç»åå¨çåºæ¯ä¸ï¼éè¦åæº¯å ¨é¨å岿°æ®ï¼ä¼è费大éçèµæºä»¥åè¶ é«çæå»ºæ¶é¿ãèåºäºä¸å¡ååçæ¶æè®¾è®¡ï¼è½è½å¤æå¤§å°ä¿è¯æ°æ®äº§åºçè§£è¦ï¼ä¿è¯ææ å£å¾çä¸è´æ§ï� �使¯å¯¹Kylinæå»ºäº§çäºå¾å¤§çååï¼è¿è导è´èµæºå ç¨å¤§ãèæ¶é¿ãåºäºä»¥ä¸ä¸å¡ç°ç¶ï¼æä»¬å½çº³äºKylinçMOLAP模å¼ä¸åå¨çé®é¢ï¼å ·ä½å¦ä¸ï¼</p> + +<ul> + <li><strong>æçé®é¢å½ä¸é¾ï¼å®ç°åçï¼</strong>ï¼æå»ºè¿ç¨æ¥éª¤å¤ï¼åæ¥éª¤ä¹é´å¼ºå ³èï¼ä» ä»é®é¢ç表象å¾é¾åç°é®é¢çæ ¹æ¬åå ï¼æ æ³è¡ä¹ææå°è§£å³é®é¢ã</li> + <li><strong>æå»ºå¼ææªè¿ä»£ï¼æå»ºè¿ç¨ï¼</strong>ï¼åå²ä»»å¡ä»éç¨MapReduceä½ä¸ºæå»ºå¼æï¼æ²¡æåæ¢å°æå»ºæçæ´é«çSparkã</li> + <li><strong>èµæºå©ç¨ä¸åçï¼æå»ºè¿ç¨ï¼</strong>ï¼èµæºæµªè´¹ãèµæºçå¾ ï¼é»è®¤å¹³å°å¨æèµæºéé æ¹å¼ï¼å¯¼è´å°ä»»å¡ç³è¯·äºå¤§éèµæºï¼æ°æ®ååä¸åçï¼äº§çäºå¤§éçå°æä»¶ï¼ä»èé æèµæºæµªè´¹ã大éä»»å¡çå¾ ã</li> + <li><strong>æ ¸å¿ä»»å¡èæ¶é¿ï¼å®æ½è·¯çº¿ï¼</strong>ï¼æå¤©éå®äº¤æä¸ç»©æ°æ®ææ çæºè¡¨æ°æ®é大ã维度ç»åå¤ãè¨èçé«ï¼å¯¼è´æ¯å¤©æå»ºçæ¶é¿è¶ è¿2ä¸ªå°æ¶ã</li> + <li><strong>SLAè´¨éä¸è¾¾æ ï¼å®æ½è·¯çº¿ï¼</strong>ï¼SLAçæ´ä½è¾¾æçæªè½è¾¾å°é¢æç®æ ã</li> +</ul> + +<p>å¨è®¤çåæå®é®é¢ï¼å¹¶ç¡®å®ææçå¤§ç®æ åï¼æä»¬å¯¹Kylinçæå»ºè¿ç¨è¿è¡äºåç±»ï¼æè§£åºå¨æå»ºè¿ç¨ä¸è½æåæççæ ¸å¿ç¯èï¼éè¿âåç解读âãâå±å±æè§£âãâç±ç¹åé¢âçææ®µï¼è¾¾æååéä½çç®æ ãå ·ä½éåç®æ å¦ä¸å¾æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-02.png" alt="" /></p> + +<h2 id="section-2">ä¼ååæ-åç解读</h2> + +<p>为äºè§£å³æçæåå®ä½é¾ãå½å é¾çé®é¢ï¼æä»¬è§£è¯»äºKylinæå»ºåçï¼å å«äºé¢è®¡ç®ææ³ä»¥åBy-layeréå±ç®æ³ã</p> + +<h3 id="section-3">é¢è®¡ç®</h3> + +<p>æ ¹æ®ç»´åº¦ç»ååºææå¯è½ç维度ï¼å¯¹å¤ç»´åæå¯è½ç¨å°çææ è¿è¡é¢è®¡ç®ï¼å°è®¡ç®å¥½çç»æä¿åæCubeãå设æä»¬æ4个维度ï¼è¿ä¸ªCube䏿¯ä¸ªèç¹ï¼<strong>ç§°ä½Cuboid</strong>ï¼é½æ¯è¿4个维度çä¸åç»åï¼æ¯ä¸ªç»åå®ä¹äºä¸ç»åæç维度ï¼<strong>å¦group by</strong>ï¼ï¼ææ çèåç»æå°±ä¿å卿¯ä¸ªCuboidä¸ãæ¥è¯¢æ¶ï¼æä»¬æ ¹æ®SQLæ¾å°å¯¹åºçCuboidï¼è¯»åææ çå¼ï¼å³å¯è¿åãå¦ä¸å¾æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-03.png" alt="" /></p> + +<h3 id="by-layer">By-layeréå±ç®æ³</h3> + +<p>ä¸ä¸ªNç»´çCubeï¼æ¯ç±1个Nç»´åç«æ¹ä½ãN个ï¼N-1ï¼ç»´åç«æ¹ä½ãN*(N-1)/2个(N-2)ç»´åç«æ¹ä½ãâ¦â¦N个1ç»´åç«æ¹ä½å1个0ç»´åç«æ¹ä½ææï¼æ»å ±æ 2^N个åç«æ¹ä½ãå¨éå±ç®æ³ä¸ï¼æç §ç»´åº¦æ°éå±åå°æ¥è®¡ç®ï¼æ¯ä¸ªå±çº§ç计ç®ï¼é¤äºç¬¬ä¸å±ï¼ç±åå§æ°æ®èåèæ¥ï¼ï¼æ¯åºäºä¸ä¸å±çº§ç计ç®ç»ææ¥è®¡ç®çã</p> + +<p>ä¾å¦ï¼group by [A,B]çç»æï¼å¯ä»¥åºäºgroup by [A,B,C]çç»æï¼éè¿å»æCåèå徿¥çï¼è¿æ ·å¯ä»¥åå°éå¤è®¡ç®ï¼å½0ç»´Cuboid计ç®åºæ¥çæ¶åï¼æ´ä¸ªCubeç计ç®ä¹å°±å®æäºãå¦ä¸å¾æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-04.png" alt="" /></p> + +<h2 id="section-4">è¿ç¨åæ-å±å±æè§£</h2> + +<p>å¨äºè§£å®Kylinçåºå±åçåï¼æä»¬å°ä¼åçæ¹åéå®å¨â弿鿩âãâæ°æ®è¯»åâãâæå»ºåå ¸âãâåå±æå»ºâãâæä»¶è½¬æ¢âäºä¸ªç¯èï¼åç»ååé¶æ®µçé®é¢ãæè·¯åç®æ åï¼æä»¬ç»äºåå°äºå¨éä½è®¡ç®èµæºçåæ¶éä½äºèæ¶ã详æ å¦ä¸è¡¨æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-05.png" alt="" /></p> + +<h3 id="section-5">æå»ºå¼æéæ©</h3> + +<p>ç®åï¼æä»¬å·²ç»å°æå»ºå¼æå·²éæ¥åæ¢ä¸ºSparkãæå¤©æ©å¨2016年就使ç¨Kylinä½ä¸ºOLAP弿ï¼åå²ä»»å¡æ²¡æåæ¢ï¼ä» ä» é对MapReduceåäºåæ°ä¼åãå ¶å®å¨2017å¹´ï¼Kylinå®ç½å·²å¯ç¨Sparkä½ä¸ºæå»ºå¼æï¼å®ç½å¯ç¨Sparkæå»ºå¼æï¼ï¼æå»ºæçç¸è¾MapReduceæå1è³3åï¼è¿å¯éè¿Cubeè®¾è®¡éæ©åæ¢ï¼å¦ä¸å¾æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-06.png" alt="" /></p> + +<h3 id="section-6">è¯»åæºæ°æ®</h3> + +<p>Kylin以å¤é¨è¡¨çæ¹å¼è¯»åHiveä¸çæºæ°æ®ï¼è¡¨ä¸çæ°æ®æä»¶ï¼<strong>åå¨å¨HDFS</strong>ï¼ä½ä¸ºä¸ä¸ä¸ªåä»»å¡çè¾å ¥ï¼æ¤è¿ç¨å¯è½åå¨å°æä»¶é®é¢ãå½åï¼Kylin䏿¸¸æ°æ®å®½è¡¨æä»¶æ°å叿¯è¾åçï¼æ éå¨ä¸æ¸¸è®¾ç½®åå¹¶ï¼å¦æå¼ºè¡åå¹¶åèä¼å¢å 䏿¸¸æºè¡¨æ°æ®å å·¥æ¶é´ã</p> + +<p>对äºé¡¹ç®éæ±ï¼è¦åå·å岿°æ®æå¢å 维度ç»åï¼éè¦éæ°æå»ºå ¨é¨çæ°æ®ï¼é常éç¨æææå»ºçæ¹å¼åå·åå²ï¼å è½½çååºè¿å¤åºç°å°æä»¶é®é¢ï¼å¯¼è´æ¤è¿ç¨æ§è¡ç¼æ ¢ãå¨Kylin级å«éåé ç½®æä»¶ï¼å¯¹å°æä»¶è¿è¡åå¹¶ï¼åå°Mapæ°éï¼å¯ææå°æå读åæçã</p> + +<p><strong>åå¹¶æºè¡¨å°æä»¶</strong>ï¼åå¹¶Hiveæºè¡¨ä¸å°æä»¶ä¸ªæ°ï¼æ§å¶æ¯ä¸ªJobå¹¶è¡çTask个æ°ãè°æ´åæ°å¦ä¸è¡¨æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-07.png" alt="" /></p> + +<p><strong>Kylin级å«åæ°éå</strong>ï¼è®¾ç½®Map读åè¿ç¨çæä»¶å¤§å°ãè°æ´åæ°å¦ä¸è¡¨æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-08.png" alt="" /></p> + +<h3 id="section-7">æå»ºåå ¸</h3> + +<p>Kylinéè¿è®¡ç®Hive表åºç°ç维度å¼ï¼å建维度åå ¸ï¼å°ç»´åº¦å¼æ å°æç¼ç ï¼å¹¶ä¿åä¿åç»è®¡ä¿¡æ¯ï¼è约HBaseåå¨èµæºãæ¯ä¸ç§ç»´åº¦ç»åï¼ç§°ä¸ºä¸ä¸ªCuboidãçè®ºä¸æ¥è¯´ï¼ä¸ä¸ªNç»´çCubeï¼ä¾¿æ2^Nç§ç»´åº¦ç»åã</p> + +<h4 id="section-8">ç»åæ°éæ¥ç</h4> + +<p>å¨å¯¹ç»´åº¦ç»ååªæåï¼å®é 计ç®ç»´åº¦ç»åé¾ä»¥è®¡ç®ï¼å¯éè¿æ§è¡æ¥å¿ï¼<strong>æªå¾ä¸ºæåäºå®è¡¨å¯ä¸åçæ¥éª¤ä¸ï¼æåä¸ä¸ªReduceçæ¥å¿</strong>ï¼ï¼æ¥çå ·ä½ç维度ç»åæ°éãå¦ä¸å¾æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-09.png" alt="" /></p> + +<h4 id="section-9">å ¨å±åå ¸ä¾èµ</h4> + +<p>æå¤©æå¾å¤ä¸å¡åºæ¯éè¦ç²¾ç¡®å»éï¼å½åå¨å¤ä¸ªå ¨å±åå ¸åæ¶ï¼å¯è®¾ç½®åä¾èµï¼ä¾å¦ï¼å½åæ¶åå¨âé¨åºæ°éâãâå¨çº¿é¨åºæ°éâæ°æ®ææ ï¼å¯è®¾ç½®åä¾èµï¼åå°å¯¹è¶ é«åºç»´åº¦ç计ç®ãå¦ä¸å¾æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-10.png" alt="" /></p> + +<h4 id="section-10">计ç®èµæºé ç½®</h4> + +<p>彿æ ä¸åå¨å¤ä¸ªç²¾åå»éææ æ¶ï¼å¯éå½å¢å 计ç®èµæºï¼æå对é«åºç»´åº¦æå»ºçæçãåæ°è®¾ç½®å¦ä¸è¡¨æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-11.png" alt="" /></p> + +<h3 id="section-11">åå±æå»º</h3> + +<p>æ¤è¿ç¨ä¸ºKylinæå»ºçæ ¸å¿ï¼åæ¢Spark弿åï¼é»è®¤åªéç¨By-layeréå±ç®æ³ï¼ä¸åèªå¨éæ©ï¼By-layeréå±ç®æ³ãå¿«éç®æ³ï¼ãSparkå¨å®ç°By-layeréå±ç®æ³çè¿ç¨ä¸ï¼ä»æåºå±çCuboidä¸å±ä¸å±å°åä¸è®¡ç®ï¼ç´å°è®¡ç®åºæé¡¶å±çCuboidï¼ç¸å½äºæ§è¡äºä¸ä¸ªä¸å¸¦group byçæ¥è¯¢ï¼ï¼å°åå±çç»ææ°æ®ç¼åå°å åä¸ï¼è·³è¿æ¯æ¬¡æ°æ®ç读åè¿ç¨ï¼ç´æ¥ä¾èµä¸å±çç¼åæ°æ®ï¼å¤§å¤§æé«äºæ§è¡æçãSparkæ§è¡è¿ç¨å ·ä½å å®¹å¦ ä¸ã</p> + +<h4 id="job">Jobé¶æ®µ</h4> + +<p>Job个æ°ä¸ºBy-layerç®æ³æ ç屿°ï¼Sparkå°æ¯å±ç»ææ°æ®çè¾åºï¼ä½ä¸ºä¸ä¸ªJobãå¦ä¸å¾æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-12.png" alt="" /></p> + +<h4 id="stage">Stageé¶æ®µ</h4> + +<p>æ¯ä¸ªJob对åºä¸¤ä¸ªStageé¶æ®µï¼å为读åä¸å±ç¼åæ°æ®åç¼å该å±è®¡ç®åçç»ææ°æ®ãå¦ä¸å¾æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-13.png" alt="" /></p> + +<h4 id="task">Taskå¹¶è¡åº¦è®¾ç½®</h4> + +<p>Kylinæ ¹æ®é¢ä¼°æ¯å±æå»ºCuboidç»åæ°æ®ç大å°ï¼<strong>å¯éè¿ç»´åº¦åªæçæ¹å¼ï¼åå°ç»´åº¦ç»åçæ°éï¼éä½Cuboidç»åæ°æ®ç大å°ï¼æåæå»ºæçï¼æ¬ææä¸è¯¦ç»ä»ç»</strong>ï¼åå岿°æ®çåæ°å¼è®¡ç®åºä»»å¡å¹¶è¡åº¦ã计ç®å ¬å¼å¦ä¸ï¼</p> + +<ul> + <li> + <p><strong>Task个æ°è®¡ç®å ¬å¼</strong>ï¼Min(MapSize/cut-mb ï¼MaxPartition) ï¼Max(MapSize/cut-mb ï¼MinPartition)</p> + </li> + <li> + <ul> + <li><strong>MapSize</strong>ï¼æ¯å±æå»ºçCuboidç»å大å°ï¼å³ï¼Kylin对åå±çº§ç»´åº¦ç»å大å°çé¢ä¼°å¼ã</li> + <li><strong>cut-mb</strong>ï¼å岿°æ®å¤§å°ï¼æ§å¶Taskä»»å¡å¹¶è¡ä¸ªæ°ï¼å¯éè¿kylin.engine.spark.rdd-partition-cut-mbåæ°è®¾ç½®ã</li> + <li><strong>MaxPartition</strong>ï¼æå¤§ååºï¼å¯éè¿kylin.engine.spark.max-partitionåæ°è®¾ç½®ã</li> + <li><strong>MinPartition</strong>ï¼æå°ååºï¼å¯éè¿kylin.engine.spark.min-partitionåæ°è®¾ç½®ã</li> + </ul> + </li> + <li><strong>è¾åºæä»¶ä¸ªæ°è®¡ç®</strong>ï¼æ¯ä¸ªTaskä»»å¡å°æ§è¡å®æåçç»ææ°æ®å缩ï¼åå ¥HDFSï¼ä½ä¸ºæä»¶è½¬æ¢è¿ç¨çè¾å ¥ãæä»¶ä¸ªæ°å³ä¸ºï¼Taskä»»å¡è¾åºæä»¶ä¸ªæ°çæ±æ»ã</li> +</ul> + +<h4 id="section-12">èµæºç³è¯·è®¡ç®</h4> + +<p>å¹³å°é»è®¤éç¨å¨ææ¹å¼ç³è¯·è®¡ç®èµæºï¼å个Executorç计ç®è½åå å«ï¼1个é»è¾CPUï¼ä»¥ä¸ç®ç§°CPUï¼ã6GBå å å åã1GBçå å¤å åã计ç®å ¬å¼å¦ä¸ï¼</p> + +<ul> + <li><strong>CPU</strong> = kylin.engine.spark-conf.spark.executor.cores * å®é ç³è¯·çExecutors个æ°ã</li> + <li><strong>å å</strong> =ï¼kylin.engine.spark-conf.spark.executor.memory + spark.yarn.executor.memoryOverheadï¼* å®é ç³è¯·çExecutors个æ°ã</li> + <li><strong>å个Executorçæ§è¡è½å</strong> = kylin.engine.spark-conf.spark.executor.memory / kylin.engine.spark-conf.spark.executor.coresï¼å³ï¼1个CPUæ§è¡è¿ç¨ä¸ç³è¯·çå å大å°ã</li> + <li><strong>æå¤§Executors个æ°</strong> = kylin.engine.spark-conf.spark.dynamicAllocation.maxExecutorsï¼å¹³å°é»è®¤å¨æç³è¯·ï¼è¯¥åæ°é嶿大ç³è¯·ä¸ªæ°ã</li> +</ul> + +<p>å¨èµæºå è¶³çæ åµä¸ï¼è¥å个Stageé¶æ®µç³è¯·1000个并è¡ä»»å¡ï¼åéè¦ç³è¯·èµæºè¾¾å°7000GBå åå1000个CPUï¼å³ï¼<code class="highlighter-rouge">CPUï¼1*1000=1000ï¼å åï¼ï¼6+1ï¼*1000=7000GB</code>ã</p> + +<h4 id="section-13">èµæºåçåéé </h4> + +<p>ç±äºBy-layeréå±ç®æ³çç¹æ§ï¼ä»¥åSparkå¨å®é æ§è¡è¿ç¨ä¸çå缩æºå¶ï¼å®é æ§è¡çTaskä»»å¡å è½½çååºæ°æ®è¿è¿å°äºåæ°è®¾ç½®å¼ï¼ä»è导è´ä»»å¡è¶ é«å¹¶è¡ï¼å ç¨å¤§éèµæºï¼åæ¶äº§ç大éçå°æä»¶ï¼å½±å䏿¸¸æä»¶è½¬æ¢è¿ç¨ãå æ¤ï¼åççååæ°æ®æä¸ºä¼åçå ³é®ç¹ãéè¿Kylinæå»ºæ¥å¿ï¼å¯æ¥çåå±çº§çCuboidç»åæ°æ®çé¢ä¼°å¤§å°ï¼ä»¥åååçååºä¸ªæ°ï¼çäºStageé¶æ®µå®é çæçTask个æ°ï¼ãå¦ä¸å� �¾æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-14.png" alt="" /></p> + +<p>ç»åSpark UI坿¥ç宿§è¡æ åµï¼è°æ´å åçç³è¯·ï¼æ»¡è¶³æ§è¡æéè¦çèµæºå³å¯ï¼åå°èµæºæµªè´¹ã</p> + +<ol> + <li>æ´ä½èµæºç³è¯·æå°å¼å¤§äºStageé¶æ®µTop1ãTop2å±çº§çç¼åæ°æ®ä¹åï¼ä¿è¯ç¼åæ°æ®å ¨é¨å¨å åãå¦ä¸å¾æç¤ºï¼</li> +</ol> + +<p><img src="/images/blog/meituan_cn/chart-15.png" alt="" /></p> + +<p><strong>计ç®å ¬å¼</strong>ï¼Stageé¶æ®µTop1ãTop2å±çº§çç¼åæ°æ®ä¹å &lt; kylin.engine.spark-conf.spark.executor.memory * kylin.engine.spark-conf.spark.memory.fraction * spark.memory.storageFraction *æå¤§Executors个æ°</p> + +<ol> + <li>å个Taskå®é æéè¦çå ååCPUï¼<strong>1个Taskæ§è¡ä½¿ç¨1个CPU</strong>ï¼å°äºå个Executorçæ§è¡è½åãå¦ä¸å¾æç¤ºï¼</li> +</ol> + +<p><img src="/images/blog/meituan_cn/chart-16.png" alt="" /></p> + +<p><strong>计ç®å ¬å¼</strong>ï¼å个Taskå®é æéè¦çå å &lt; kylin.engine.spark-conf.spark.executor.memory * kylin.engine.spark-conf.spark.memory.fraction * spark.memory.st·orageFraction / kylin.engine.spark-conf.spark.executor.coresãåæ°è¯´æå¦ä¸è¡¨æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-17.png" alt="" /></p> + +<h3 id="section-14">æä»¶è½¬æ¢</h3> + +<p>Kylinå°æå»ºä¹åçCuboidæä»¶è½¬æ¢æHTableæ ¼å¼çHfileæä»¶ï¼éè¿BulkLoadçæ¹å¼å°æä»¶åHTableè¿è¡å ³èï¼å¤§å¤§éä½äºHBaseçè´è½½ãæ¤è¿ç¨éè¿ä¸ä¸ªMapReduceä»»å¡å®æï¼Map个æ°ä¸ºåå±æå»ºé¶æ®µè¾åºæä»¶ä¸ªæ°ãæ¥å¿å¦ä¸ï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-18.png" alt="" /></p> + +<p>æ¤é¶æ®µå¯æ ¹æ®å®é è¾å ¥çæ°æ®æä»¶å¤§å°ï¼<strong>å¯éè¿MapReduceæ¥å¿æ¥ç</strong>ï¼ï¼åçç³è¯·è®¡ç®èµæºï¼é¿å èµæºæµªè´¹ã</p> + +<p>计ç®å ¬å¼ï¼Mapé¶æ®µèµæºç³è¯· = kylin.job.mr.config.override.mapreduce.map.memory.mb * åå±æå»ºé¶æ®µè¾åºæä»¶ä¸ªæ°ãå ·ä½åæ°å¦ä¸è¡¨æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-19.png" alt="" /></p> + +<h2 id="section-15">宿½è·¯çº¿-ç±ç¹åé¢</h2> + +<h3 id="section-16">交æè¯ç¹å®è·µ</h3> + +<p>æä»¬éè¿å¯¹Kylinåçç解读以åæå»ºè¿ç¨çå±å±æè§£ï¼éåéå®äº¤ææ ¸å¿ä»»å¡è¿è¡è¯ç¹å®è·µãå¦ä¸å¾æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-20.png" alt="" /></p> + +<h3 id="section-17">å®è·µç»æå¯¹æ¯</h3> + +<p>é对éå®äº¤ææ ¸å¿ä»»å¡è¿è¡å®è·µä¼åï¼å¯¹æ¯è°æ´ååèµæºå®é ä½¿ç¨æ åµåæ§è¡æ¶é¿ï¼æç»è¾¾å°ååéä½çç®æ ãå¦ä¸å¾æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-21.png" alt="" /></p> + +<h2 id="section-18">ææå±ç¤º</h2> + +<h3 id="section-19">èµæºæ´ä½æ åµ</h3> + +<p>æå¤©ç°æ20+çKylinä»»å¡ï¼ç»è¿åå¹´æ¶é´æç»ä¼åè¿ä»£ï¼å¯¹æ¯KylinèµæºéåæåCU使ç¨éåPendingä»»å¡CU使ç¨éï¼å¨åçä»»å¡ä¸èµæºæ¶èå·²ææ¾éä½ãå¦ä¸å¾æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-23.png" alt="" /></p> + +<h3 id="sla">SLAæ´ä½è¾¾æç</h3> + +<p>ç»è¿äºç±ç¹åé¢çæ´ä½ä¼åï¼æå¤©äº2020å¹´6æSLAè¾¾æçè¾¾å°100%ãå¦ä¸å¾æç¤ºï¼</p> + +<p><img src="/images/blog/meituan_cn/chart-24.png" alt="" /></p> + +<h2 id="section-20">屿</h2> + +<p>Apache Kylinå¨2015å¹´11ææ£å¼æä¸ºApacheåºéä¼ç顶级项ç®ãä»å¼æºå°æä¸ºApache顶级项ç®ï¼åªè±äº13个æçæ¶é´ï¼èä¸å®ä¹æ¯ç¬¬ä¸ä¸ªç±ä¸å½å¢é宿´è´¡ç®å°Apacheç顶级项ç®ã</p> + +<p>ç®åï¼ç¾å¢éç¨æ¯è¾ç¨³å®çV2.0çæ¬ï¼ç»è¿è¿4å¹´ç使ç¨ä¸ç§¯ç´¯ï¼å°åºé¤é¥®ææ¯å¢éå¨ä¼åæ¥è¯¢æ§è½ä»¥åæå»ºæçå±é¢é½ç§¯ç´¯äºå¤§éç»éªï¼æ¬æä¸»è¦éè¿°äºå¨Sparkæå»ºè¿ç¨çèµæºéé æ¹æ³ãå¼å¾ä¸æçæ¯ï¼Kylin宿¹å¨2020å¹´7æåå¸äºV3.1çæ¬ï¼å¼å ¥äºFlinkä½ä¸ºæå»ºå¼æï¼ç»ä¸ä½¿ç¨Flinkæå»ºæ ¸å¿è¿ç¨ï¼å 嫿°æ®è¯»åé¶æ®µãæå»ºåå ¸é¶æ®µãåå±æå»ºé¶æ®µãæä»¶è½¬æ¢é¶æ®µï¼ä»¥ä¸åé¨åå æ´ä½æå»ºèæ¶ ç95%以ä¸ãæ¤æ¬¡çæ¬çå级ä¹å¤§å¹ 度æé«äºKylinçæå»ºæçã详æ 坿¥çï¼Flink Cube Build Engineã</p> + +<p>å顾Kylinæå»ºå¼æçå级è¿ç¨ï¼ä»MapReduceå°Sparkï¼åå°å¦ä»çFlinkï¼æå»ºå·¥å ·çè¿ä»£å§ç»åæ´å ä¼ç§ç主æµå¼æå¨é æ¢ï¼èä¸Kylinç¤¾åºæå¾å¤æ´»è·çä¼ç§ä»£ç è´¡ç®è ï¼ä»ä»¬ä¹å¨å¸®å©æ©å¤§Kylinççæï¼å¢å æ´å¤çæ°åè½ï¼é常å¼å¾å¤§å®¶å¦ä¹ ãæåï¼ç¾å¢å°åºé¤é¥®ææ¯å¢é忬¡è¡¨è¾¾å¯¹Apache Kylin项ç®å¢éçæè°¢ã</p> +</description> + <pubDate>Tue, 03 Aug 2021 08:00:00 -0700</pubDate> + <link>http://kylin.apache.org/cn_blog/2021/08/03/How-Meituan-Dominates-Online-Shopping-with-Apache-Kylin/</link> + <guid isPermaLink="true">http://kylin.apache.org/cn_blog/2021/08/03/How-Meituan-Dominates-Online-Shopping-with-Apache-Kylin/</guid> + + + <category>cn_blog</category> + + </item> + + <item> + <title>How Meituan Dominates Online Shopping with Apache Kylin</title> + <description><p>Letâs face it, online shopping now affects nearly every part of our shopping lives. From ordering groceries to <a href="https://www.carvana.com/">purchasing a car</a>, weâre living in an age of limitless choices when it comes to online commerce. Nowhere is this more the case than with the worldâs 2nd largest consumer market: China.</p> + +<p>Leading the online shopping revolution in China is Meituan, who since 2016 has grown to support nearly 460 million consumers from over 2,000 industries, regularly processing hundreds of $billions in transactions. To support these staggering operations, Meituan has invested heavily in its data analytics system and employs more than 10,000 engineers to ensure a stable and reliable experience for their customers.</p> + +<p>But the driving force behind Meituanâs success is not simply a robust analytics system. While the organizationâs executives might think so, its engineers understand that it is the OLAP engine that system is built upon that has empowered the company to move quickly and win in the market.</p> + +<h2 id="meituans-secret-weapon-apache-kylin"><strong>Meituanâs Secret Weapon: Apache Kylin</strong></h2> + +<p>Since 2016, Meituanâs technical team has relied on<a href="https://kyligence.io/apache-kylin-overview/"> Apache Kylin</a> to power their<a href="https://kyligence.io/resources/extreme-olap-with-apache-kylin/"> OLAP engine</a>. Apache Kylin, an open source OLAP engine built on the Hadoop platform, resolves complex queries at sub-second speeds through multidimensional precomputation, allowing for blazing-fast analysis on even the largest datasets.</p> + +<p>However, the limitations of this open source solution became apparent as the companyâs business grew, becoming less and less efficient as cubes and queries became larger and more complex. To solve this problem, the engineering team leveraged Kylinâs open source foundations to dig into the engine, understand its underlying principles, and develop an implementation strategy that other organizations using Kylin can adopt to greatly improve their data output efficiency.</p> + +<p>Meituanâs technical team has graciously shared their story of this process below so that you can apply it toward solving your own big data challenges.</p> + +<h2 id="a-global-pandemic-and-a-new-normal-for-business"><strong>A Global Pandemic and a New Normal for Business</strong></h2> + +<p>For the last four years, Meituanâs Qingtian sales system has served as the companyâs data processing workhorse, handling massive amounts of daily sales data involving a wide range of highly complex technical scenarios. The stability and efficiency of this system is paramount, and itâs why Meituanâs engineers have made significant investments in optimizing the OLAP engine Qingtian is built upon.</p> + +<p>After a thorough investigation, the team identified Apache Kylin as the only OLAP engine that could meet their needs and scale with anticipated growth. The engine was rolled out in 2016 and, over the next few years, Kylin played an important role in the companyâs evolving data analytics system.</p> + +<p>Growth expectations, however, turned out to be severely underestimated, as a global pandemic quickly drove major changes in how consumers shopped and how businesses sold their goods. Such a massive shift in online shopping led to even faster growth for Meituan as well as a nearly untenable amount of new business data.</p> + +<p>This caused efficiency bottlenecks that even their Kylin-based system started to struggle with. Cube building and query performance was unable to keep up with these changes in consumer behaviors, slowing down data analysis and decision-making and creating a major obstacle towards addressing user experiences.</p> + +<p>Meituanâs technical team would spend the next six months carrying out optimizations and iterations for Kylin, including dimension pruning, model design, resource adaptation, and improving SLA compliance.</p> + +<h2 id="responding-to-new-consumer-behaviors-with-apache-kylin"><strong>Responding to New Consumer Behaviors with Apache Kylin</strong></h2> + +<p>In order to understand the approach taken when optimizing Meituanâs data architecture, itâs important to understand how the business is managed. The companyâs sales force operates with two business models â in-store sales and phone sales â and is then further broken down by various territories and corporate departments. All analytics data must be communicated across both business models.</p> + +<p>With this in mind, Meituan engineers incorporated Kylin into their design of the data architecture as follows:</p> + +<p><img src="/images/blog/meituan/chart-01.jpeg" alt="" /></p> + +<p>Figure 3. Apache Kylinâs layer-by-layer building data flow</p> + +<p>While this design addressed many of Meituanâs initial concerns around scalability and efficiency, continued shifts in consumer behaviors and the organizationâs response to dramatic changes in the market put enormous pressure on Kylin when it came to building cubes. This lead to an unsustainable level of consumption of both resources and time.</p> + +<p>It became clear that Kylinâs MOLAP model was presenting the following challenges:</p> + +<ul> + <li>The build process involved many steps that were highly correlated, making it difficult to root cause problems.</li> + <li>MapReduce - instead of the more efficient Spark - was still being used as the build engine for historical tasks.</li> + <li>The platformâs default dynamic resource adaption method demanded considerable resources for small tasks. Data was sharded unnecessarily and a large number of small files were generated, resulting in a waste of resources.</li> + <li>Data volumes Meituan was now having to work with were well beyond the original architectural plan, resulting in two hours of cube building every day.</li> + <li>The overall SLA fulfillment rate remained lower than expected.</li> +</ul> + +<p>Recognizing these problems, the team set a goal of improving the platformâs efficiency (you can see the quantitative targets below). Finding a solution would involve classifying Kylinâs build process, digging into how Kylin worked under the hood, breaking down that process, and finally implementing a solution.</p> + +<p><img src="/images/blog/meituan/chart-02.png" alt="" /></p> + +<p>Figure 4. Implementation path diagram</p> + +<h2 id="optimization-understanding-how-apache-kylin-builds-cubes"><strong>Optimization: Understanding How Apache Kylin Builds Cubes</strong></h2> + +<p>Understanding the cube building process is critical for pinpointing efficiency and performance issues. In the case of Kylin, a solid grasp of its precomputation approach and its âby layerâ cubing algorithm are necessary when formulating a solution.</p> + +<p><strong>Precomputation with Apache Kylin</strong></p> + +<p>Apache Kylin generates all possible dimensional combinations and pre-calculates the metrics that may be used in future multidimensional analysis, saving the results as a cube. Metric aggregation results are saved on <em>cuboids</em> (a logical branch of the cube), and during queries relevant cuboids are found through SQL statements, and then read and quickly returned as metric values.</p> + +<p><img src="/images/blog/meituan/chart-03.jpeg" alt="" /></p> + +<p>Figure 5. Precomputation across four dimensions example</p> + +<p><strong>Apache Kylinâs By-Layer Cubing Algorithm</strong></p> + +<p>An N-dimensional cube is composed of 1 N-dimensional sub-cube, N (N-1)-dimensional sub-cubes, N*(N-1)/2 (N-2)-dimensional sub-cubes, â¦, N 1-dimensional sub-cubes, and one 0-dimensional sub-cube, consisting of a total of 2^N sub-cubes. In Kylinâs by-layer cubing algorithm, the number of dimensions decreases with the calculation of each layer, and each layerâs calculation is based on the calculation result of its parent layer (except the first layer, which bases it on the source data).</p> + +<p><img src="/images/blog/meituan/chart-04.png" alt="" /></p> + +<p>Figure 6. Cuboid example</p> + +<h2 id="the-proof-is-in-the-process"><strong>The Proof Is in the Process</strong></h2> + +<p>Understanding the principles outlined above, the Meituan team identified five key areas to focus on for optimization: engine selection, data reading, dictionary building, layer-by-layer build, and file conversion. Addressing these areas would lead to the greatest gains in reducing the required resources for calculation and shortening processing time.</p> + +<p>The team outlined the challenges, their solutions, and key objectives in the following table:</p> + +<p><img src="/images/blog/meituan/chart-05.jpeg" alt="" /></p> + +<p>Figure 7. Breakdown of Apache Kylinâs process</p> + +<h2 id="putting-apache-kylin-to-the-test"><strong>Putting Apache Kylin to the Test</strong></h2> + +<p>With their solutions in place, the next step was to test if Kylinâs build process had actually improved. To do this, the team selected a set of critical sales tasks and ran a pilot (outlined below):</p> + +<p><img src="/images/blog/meituan/chart-06.jpeg" alt="" /></p> + +<p>Figure 8. Meituanâs pilot program for their Apache Kylin optimizations</p> + +<p>The results of the pilot were astonishing. Ultimately, the team was able to realize a significant reduction in resource consumption as seen in the following chart:</p> + +<p><img src="/images/blog/meituan/chart-07.jpeg" alt="" /></p> + +<p>Figure 9. Resource usage and performance of Apache Kylin before and after pilot</p> + +<h2 id="analytics-optimized"><strong>Analytics Optimize</strong>d</h2> + +<p>Today, Meituanâs Qingtian system is processing over 20 different Kylin tasks, and after six months of constant optimization, the monthly CU usage for Kylinâs resource queue and the CU usage for pending tasks have seen significant reductions.</p> + +<p><img src="/images/blog/meituan/chart-08.jpeg" alt="" /></p> + +<p>Figure 10. Current performance of Apache Kylin after solution implementation</p> + +<p>Resource usage isnât the only area of impressive improvement. The Qingtian systemâs SLA compliance also was able to reach 100% as of June 2020.</p> + +<p><img src="/images/blog/meituan/chart-09.jpeg" alt="" /></p> + +<p>Figure 11. Meituan SLA compliance after Apache Kylin optimization</p> + +<h2 id="taking-on-the-future-with-apache-kylin"><strong>Taking on the Future with Apache Kylin</strong></h2> + +<p>Over the past four years, Meituanâs technical team has accumulated a great deal of experience in optimizing query performance and build efficiency with Apache Kylin. But Meituanâs success is also the story of open sourceâs success.</p> + +<p>The<a href="http://kylin.apache.org/community/"> Apache Kylin community</a> has many active and outstanding code contributors (<a href="https://kyligence.io/comparing-kylin-vs-kyligence/">including Kyligence</a>), who are relentlessly working to expand the Kylin ecosystem and add more new features. Itâs in sharing success stories like this that Apache Kylin is able to remain the leading open source solution for analytics on massive datasets.</p> + +<p>Together, with the entire Apache Kylin community, Meituan is making sure critical analytics work can remain unburdened by growing datasets, and that when the next major shift in business takes place, industry leaders like Meituan will be able to analyze whatâs happening and quickly take action.</p> +</description> + <pubDate>Tue, 03 Aug 2021 08:00:00 -0700</pubDate> + <link>http://kylin.apache.org/blog/2021/08/03/How-Meituan-Dominates-Online-Shopping-with-Apache-Kylin/</link> + <guid isPermaLink="true">http://kylin.apache.org/blog/2021/08/03/How-Meituan-Dominates-Online-Shopping-with-Apache-Kylin/</guid> + + + <category>blog</category> + + </item> + + <item> <title>Apache kylin4 æ°æ¶æå享</title> <description><p>è¿ç¯æç« 主è¦å为以ä¸å 个é¨åï¼<br /> - Apache Kylin 使ç¨åºæ¯<br /> @@ -217,6 +577,155 @@ For example, a query joins two subquerie </item> <item> + <title>Why did Youzan choose Kylin4</title> + <description><p>At the QCon Global Software Developers Conference held on May 29, 2021, Zheng Shengjun, head of Youzanâs data infrastructure platform, shared Youzanâs internal use experience and optimization practice of Kylin 4.0 on the meeting room of open source big data frameworks and applications. <br /> +For many users of Kylin2/3(Kylin on HBase), this is also a chance to learn how and why to upgrade to Kylin 4.</p> + +<p>This sharing is mainly divided into the following parts:</p> + +<ul> + <li>The reason for choosing Kylin 4</li> + <li>Introduction to Kylin 4</li> + <li>How to optimize performance of Kylin 4</li> + <li>Practice of Kylin 4 in Youzan</li> +</ul> + +<h2 id="the-reason-for-choosing-kylin-4">01 The reason for choosing Kylin 4</h2> + +<h3 id="introduction-to-youzan">Introduction to Youzan</h3> +<p>China Youzan Co., Ltd (stock code 08083.HK). is an enterprise mainly engaged in retail technology services.<br /> +At present, it owns several tools and solutions to provide SaaS software products and talent services to help merchants operate mobile social e-commerce and new retail channels in an all-round way. <br /> +Currently Youzan has hundreds of millions of consumers and 6 million existing merchants.</p> + +<h3 id="history-of-kylin-in-youzan">History of Kylin in Youzan</h3> +<p><img src="/images/blog/youzan/1 history_of_youzan_OLAP.png" alt="" /></p> + +<p>First of all, I would like to share why Youzan chose to upgrade to Kylin 4. Here, let me briefly reviewed the history of Youzan OLAP infra.</p> + +<p>In the early days of Youzan, in order to iterate develop process quickly, we chose the method of pre-computation + MySQL; in 2018, Druid was introduced because of query flexibility and development efficiency, but there were problems such as low pre-aggregation, not supporting precisely count distinct measure. In this situation, Youzan introduced Apache Kylin and ClickHouse. Kylin supports high aggregation, precisely count distinct measure and the lowest RT, while ClickHouse is quite flexible in usage(ad hoc query).</p> + +<p>From the introduction of Kylin in 2018 to now, Youzan has used Kylin for more than three years. With the continuous enrichment of business scenarios and the continuous accumulation of data volume, Youzan currently has 6 million existing merchants, GMV in 2020 is 107.3 billion, and the daily build data volume is 10 billion +. At present, Kylin has basically covered all the business scenarios of Youzan.</p> + +<h3 id="the-challenges-of-kylin-3">The challenges of Kylin 3</h3> +<p>With Youzanâs rapid development and in-depth use of Kylin, we also encountered some challenges:</p> + +<ul> + <li>First of all, the build performance of Kylin on HBase cannot meet the favorable expectations, and the build performance will affect the userâs failure recovery time and stability experience;</li> + <li>Secondly, with the access of more large merchants (tens of millions of members in a single store, with hundreds of thousands of goods for each store), it also brings great challenges to our OLAP system. Kylin on HBase is limited by the single-point query of Query Server, and cannot support these complex scenarios well;</li> + <li>Finally, because HBase is not a cloud-native system, it is difficult to achieve flexible scale up and scale down. With the continuous growth of data volume, this system has peaks and valleys for businesses, which results in the average resource utilization rate is not high enough.</li> +</ul> + +<p>Faced with these challenges, Youzan chose to move closer and upgrade to the more cloud-native Apache Kylin 4.</p> + +<h2 id="introduction-to-kylin-4">02 Introduction to Kylin 4</h2> +<p>First of all, letâs introduce the main advantages of Kylin 4. Apache Kylin 4 completely depends on Spark for cubing job and query. It can make full use of Sparkâs parallelization, quantization(åéå), and global dynamic code generation technologies to improve the efficiency of large queries.<br /> +Here is a brief introduction to the principle of Kylin 4, that is storage engine, build engine and query engine.</p> + +<h3 id="storage-engine">Storage engine</h3> +<p><img src="/images/blog/youzan/2 kylin4_storage.png" alt="" /></p> + +<p>First of all, letâs take a look at the new storage engine, comparison between Kylin on HBase and Kylin on Parquet. The cuboid data of Kylin on HBase is stored in the table of HBase. Single Segment corresponds to one HBase table. Aggregation is pushed down to HBase coprocessor.</p> + +<p>But as we know, HBase is not a real Columnar Storage and its throughput is not enough for OLAP System. Kylin 4 replaces HBase with Parquet, all the data is stored in files. Each segment will have a corresponding HDFS directory. All queries and cubing jobs read and write files without HBase . Although there will be a certain loss of performance for simple queries, the improvement brought about by complex queries is more considerable and worthwhile.</p> + +<h3 id="build-engine">Build engine</h3> +<p><img src="/images/blog/youzan/3 kylin4_build_engine.png" alt="" /></p> + +<p>The second is the new build engine. Based on our test, the build speed of Kylin on Parquet has been optimized from 82 minutes to 15 minutes. There are several reasons:</p> + +<ul> + <li>Kylin 4 removes the encoding of the dimension, eliminating a building step of encoding;</li> + <li>Removed the HBase File generation step;</li> + <li>Kylin on Parquet changes the granularity of cubing to cuboid level, which is conducive to further improving parallelism of cubing job.</li> + <li>Enhanced implementation for global dictionary. In the new algorithm, dictionary and source data are hashed into the same buckets, making it possible for loading only piece of dictionary bucket to encode source data.</li> +</ul> + +<p>As you can see on the right, after upgradation to Kylin 4, cubing job changes from ten steps to two steps, the performance improvement of the construction is very obvious.</p> + +<h3 id="query-engine">Query engine</h3> +<p><img src="/images/blog/youzan/4 kylin4_query.png" alt="" /></p> + +<p>Next is the new query engine of Kylin 4. As you can see, the calculation of Kylin on HBase is completely dependent on the coprocessor of HBase and query server process. When the data is read from HBase into query server to do aggregation, sorting, etc, the bottleneck will be restricted by the single point of query server. But Kylin 4 is converted to a fully distributed query mechanism based on Spark, whatâs more, it âs able to do configuration tuning automatically in spark query step !</p> + +<h2 id="how-to-optimize-performance-of-kylin-4">03 How to optimize performance of Kylin 4</h2> +<p>Next, Iâd like to share some performance optimizations made by Youzan in Kylin 4.</p> + +<h3 id="optimization-of-query-engine">Optimization of query engine</h3> +<p>#### 1.Cache Calcite physical plan<br /> +<img src="/images/blog/youzan/5 cache_calcite_plan.png" alt="" /></p> + +<p>In Kylin4, SQL will be analyzed, optimized and do code generation in calcite. This step takes up about 150ms for some queries. We have supported PreparedStatementCache in Kylin4 to cache calcite plan, so that the structured SQL donât have to do the same step again. With this optimization it saved about 150ms of time cost.</p> + +<h4 id="tunning-spark-configuration">2.Tunning spark configuration</h4> +<p><img src="/images/blog/youzan/6 tuning_spark_configuration.png" alt="" /></p> + +<p>Kylin4 uses spark as query engine. As spark is a distributed engine designed for massive data processing, itâs inevitable to loose some performance for small queries. We have tried to do some tuning to catch up with the latency in Kylin on HBase for small queries.</p> + +<p>Our first optimization is to make more calculations finish in memory. The key is to avoid data spill during aggregation, shuffle and sort. Tuning the following configuration is helpful.</p> + +<ul> + <li>1.set <code class="highlighter-rouge">spark.sql.objectHashAggregate.sortBased.fallbackThreshold</code> to larger value to avoid HashAggregate fall back to Sort Based Aggregate, which really kills performance when happens.</li> + <li>2.set <code class="highlighter-rouge">spark.shuffle.spill.initialMemoryThreshold</code> to a large value to avoid to many spills during shuffle.</li> +</ul> + +<p>Secondly, we route small queries to Query Server which run spark in local mode. Because the overhead of task schedule, shuffle read and variable broadcast is enlarged for small queries on YARN/Standalone mode.</p> + +<p>Thirdly, we use RAM disk to enhance shuffle performance. Mount RAM disk as TMPFS and set spark.local.dir to directory using RAM disk.</p> + +<p>Lastly, we disabled sparkâs whole stage code generation for small queries, for sparkâs whole stage code generation will cost about 100ms~200ms, whereas itâs not beneficial to small queries which is a simple project.</p> + +<h4 id="parquet-optimization">3.Parquet optimization</h4> +<p><img src="/images/blog/youzan/7 parquet_optimization.png" alt="" /></p> + +<p>Optimizing parquet is also important for queries.</p> + +<p>The first principal is that weâd better always include shard by column in our filter condition, for parquet files are shard by shard-by-column, filter using shard by column reduces the data files to read.</p> + +<p>Then look into parquet files, data within files are sorted by rowkey columns, that is to say, prefix match in query is as important as Kylin on HBase. When a query condition satisfies prefix match, it can filter row groups with columnâs max/min index. Furthermore, we can reduce row group size to make finer index granularity, but be aware that the compression rate will be lower if we set row group size smaller.</p> + +<h4 id="dynamic-elimination-of-partitioning-dimensions">4.Dynamic elimination of partitioning dimensions</h4> +<p>Kylin4 have a new ability that the older version is not capable of, which is able to reduce dozens of times of data reading and computing for some big queries. Itâs offen the case that partition column is used to filter data but not used as group dimension. For those cases Kylin would always choose cuboid with partition column, but now it is able to use different cuboid in that query to reduce IO read and computing.</p> + +<p>The key of this optimization is to split a query into two parts, one of the part uses all segmentâs data so that partition column doesnât have to be included in cuboid, the other part that uses part of segments data will choose cuboid with partition dimension to do the data filter.</p> + +<p>We have tested that in some situations the response time reduced from 20s to 6s, 10s to 3s.</p> + +<p><img src="/images/blog/youzan/8 Dynamic_elimination_of_partitioning_dimensions.png" alt="" /></p> + +<h3 id="optimization-of-build-engine">Optimization of build engine</h3> +<p>#### 1.cache parent dataset<br /> +<img src="/images/blog/youzan/9 cache_parent_dataset.png" alt="" /></p> + +<p>Kylin build cube layer by layer. For a parent layer with multi cuboids to build, we can choose to cache parent dataset by setting kylin.engine.spark.parent-dataset.max.persist.count to a number greater than 0. But notice that if you set this value too small, it will affect the parallelism of build job, as the build granularity is at cuboid level.</p> + +<h2 id="practice-of-kylin-4-in-youzan">04 Practice of Kylin 4 in Youzan</h2> +<p>After introducing Youzanâs experience of performance optimization, letâs share the optimization effect. That is, Kylin 4âs practice in Youzan includes the upgrade process and the performance of online system.</p> + +<h3 id="upgrade-metadata-to-adapt-to-kylin-4">Upgrade metadata to adapt to Kylin 4</h3> +<p>First of all, for metadata for Kylin 3 which stored on HBase, we have developed a tool for seamless upgrading of metadata. First of all, our metadata in Kylin on HBase is stored in HBase. We export the metadata in HBase into local files, and then use tools to transform and write back the new metadata into MySQL. We also updated the operation documents and general principles in the official wiki of Apache Kylin. For more details, you can refer to: <a href="https://wiki.apache.org/confluence/display/KYLIN/How+to+migrate+metadata+to+Kylin+4">How to migrate metadata to Kylin 4</a>.</p> + +<p>Letâs give a general introduction to some compatibility in the whole process. The project metadata, tables metadata, permission-related metadata, and model metadata do not need be modified. What needs to be modified is the cube metadata, including the type of storage and query used by Cube. After updating these two fields, you need to recalculate the Cube signature. The function of this signature is designed internally by Kylin to avoid some problems caused by Cube after Cube is determined.</p> + +<h3 id="performance-of-kylin-4-on-youzan-online-system">Performance of Kylin 4 on Youzan online system</h3> +<p><img src="/images/blog/youzan/10 commodity_insight.png" alt="" /></p> + +<p>After the migration of metadata to Kylin4, letâs share the qualitative changes and substantial performance improvements brought about by some of the promising scenarios. First of all, in a scenario like Commodity Insight, there is a large store with several hundred thousand of commodities. We have to analyze its transactions and traffic, etc. There are more than a dozen precise precisely count distinct measures in single cube. Precisely count distinct measure is actually very inefficient if it is not optimized through pre-calculation and Bitmap. Kylin currently uses Bitmap to support precisely count distinct measure. In a scene that requires complex queries to sort hundreds of thousands of commodities in various UV(precisely count distinct measure), the RT of Kylin 2 is 27 seconds, while the RT of Kylin 4 is reduced from 27 seconds to less than 2 seconds.</p> + +<p>What I find most appealing to me about Kylin 4 is that itâs like a manual transmission car, you can control its query concurrency at your will, whereas you canât change query concurrency in Kylin on HBase freely, because its concurrency is completely tied to the number of regions.</p> + +<h3 id="plan-for-kylin-4-in-youzan">Plan for Kylin 4 in Youzan</h3> +<p>We have made full test, fixed several bugs and improved apache KYLIN4 for several months. Now we are migrating cubes from older version to newer version. For the cubes already migrated to KYLIN4, its small queriesâ performance meet our expectations, its complex query and build performance did bring us a big surprise. We are planning to migrate all cubes from older version to Kylin4.</p> +</description> + <pubDate>Thu, 17 Jun 2021 08:00:00 -0700</pubDate> + <link>http://kylin.apache.org/blog/2021/06/17/Why-did-Youzan-choose-Kylin4/</link> + <guid isPermaLink="true">http://kylin.apache.org/blog/2021/06/17/Why-did-Youzan-choose-Kylin4/</guid> + + + <category>blog</category> + + </item> + + <item> <title>æèµä¸ºä»ä¹éæ© Kylin4</title> <description><p>å¨ 2021å¹´5æ29æ¥ä¸¾åç QCon å ¨ç软件å¼åè 大ä¼ä¸ï¼æ¥èªæèµçæ°æ®åºç¡å¹³å°è´è´£äºº éçä¿ å¨å¤§æ°æ®å¼æºæ¡æ¶ä¸åºç¨ä¸é¢ä¸åäº«äºæèµå é¨å¯¹ Kylin 4.0 ç使ç¨ç»ååä¼åå®è·µï¼å¯¹äºä¼å¤ Kylin èç¨æ·æ¥è¯´ï¼è¿ä¹æ¯å级 Kylin 4 çå®ç¨æ»ç¥ã</p> @@ -376,155 +885,6 @@ For example, a query joins two subquerie </item> <item> - <title>Why did Youzan choose Kylin4</title> - <description><p>At the QCon Global Software Developers Conference held on May 29, 2021, Zheng Shengjun, head of Youzanâs data infrastructure platform, shared Youzanâs internal use experience and optimization practice of Kylin 4.0 on the meeting room of open source big data frameworks and applications. <br /> -For many users of Kylin2/3(Kylin on HBase), this is also a chance to learn how and why to upgrade to Kylin 4.</p> - -<p>This sharing is mainly divided into the following parts:</p> - -<ul> - <li>The reason for choosing Kylin 4</li> - <li>Introduction to Kylin 4</li> - <li>How to optimize performance of Kylin 4</li> - <li>Practice of Kylin 4 in Youzan</li> -</ul> - -<h2 id="the-reason-for-choosing-kylin-4">01 The reason for choosing Kylin 4</h2> - -<h3 id="introduction-to-youzan">Introduction to Youzan</h3> -<p>China Youzan Co., Ltd (stock code 08083.HK). is an enterprise mainly engaged in retail technology services.<br /> -At present, it owns several tools and solutions to provide SaaS software products and talent services to help merchants operate mobile social e-commerce and new retail channels in an all-round way. <br /> -Currently Youzan has hundreds of millions of consumers and 6 million existing merchants.</p> - -<h3 id="history-of-kylin-in-youzan">History of Kylin in Youzan</h3> -<p><img src="/images/blog/youzan/1 history_of_youzan_OLAP.png" alt="" /></p> - -<p>First of all, I would like to share why Youzan chose to upgrade to Kylin 4. Here, let me briefly reviewed the history of Youzan OLAP infra.</p> - -<p>In the early days of Youzan, in order to iterate develop process quickly, we chose the method of pre-computation + MySQL; in 2018, Druid was introduced because of query flexibility and development efficiency, but there were problems such as low pre-aggregation, not supporting precisely count distinct measure. In this situation, Youzan introduced Apache Kylin and ClickHouse. Kylin supports high aggregation, precisely count distinct measure and the lowest RT, while ClickHouse is quite flexible in usage(ad hoc query).</p> - -<p>From the introduction of Kylin in 2018 to now, Youzan has used Kylin for more than three years. With the continuous enrichment of business scenarios and the continuous accumulation of data volume, Youzan currently has 6 million existing merchants, GMV in 2020 is 107.3 billion, and the daily build data volume is 10 billion +. At present, Kylin has basically covered all the business scenarios of Youzan.</p> - -<h3 id="the-challenges-of-kylin-3">The challenges of Kylin 3</h3> -<p>With Youzanâs rapid development and in-depth use of Kylin, we also encountered some challenges:</p> - -<ul> - <li>First of all, the build performance of Kylin on HBase cannot meet the favorable expectations, and the build performance will affect the userâs failure recovery time and stability experience;</li> - <li>Secondly, with the access of more large merchants (tens of millions of members in a single store, with hundreds of thousands of goods for each store), it also brings great challenges to our OLAP system. Kylin on HBase is limited by the single-point query of Query Server, and cannot support these complex scenarios well;</li> - <li>Finally, because HBase is not a cloud-native system, it is difficult to achieve flexible scale up and scale down. With the continuous growth of data volume, this system has peaks and valleys for businesses, which results in the average resource utilization rate is not high enough.</li> -</ul> - -<p>Faced with these challenges, Youzan chose to move closer and upgrade to the more cloud-native Apache Kylin 4.</p> - -<h2 id="introduction-to-kylin-4">02 Introduction to Kylin 4</h2> -<p>First of all, letâs introduce the main advantages of Kylin 4. Apache Kylin 4 completely depends on Spark for cubing job and query. It can make full use of Sparkâs parallelization, quantization(åéå), and global dynamic code generation technologies to improve the efficiency of large queries.<br /> -Here is a brief introduction to the principle of Kylin 4, that is storage engine, build engine and query engine.</p> - -<h3 id="storage-engine">Storage engine</h3> -<p><img src="/images/blog/youzan/2 kylin4_storage.png" alt="" /></p> - -<p>First of all, letâs take a look at the new storage engine, comparison between Kylin on HBase and Kylin on Parquet. The cuboid data of Kylin on HBase is stored in the table of HBase. Single Segment corresponds to one HBase table. Aggregation is pushed down to HBase coprocessor.</p> - -<p>But as we know, HBase is not a real Columnar Storage and its throughput is not enough for OLAP System. Kylin 4 replaces HBase with Parquet, all the data is stored in files. Each segment will have a corresponding HDFS directory. All queries and cubing jobs read and write files without HBase . Although there will be a certain loss of performance for simple queries, the improvement brought about by complex queries is more considerable and worthwhile.</p> - -<h3 id="build-engine">Build engine</h3> -<p><img src="/images/blog/youzan/3 kylin4_build_engine.png" alt="" /></p> - -<p>The second is the new build engine. Based on our test, the build speed of Kylin on Parquet has been optimized from 82 minutes to 15 minutes. There are several reasons:</p> - -<ul> - <li>Kylin 4 removes the encoding of the dimension, eliminating a building step of encoding;</li> - <li>Removed the HBase File generation step;</li> - <li>Kylin on Parquet changes the granularity of cubing to cuboid level, which is conducive to further improving parallelism of cubing job.</li> - <li>Enhanced implementation for global dictionary. In the new algorithm, dictionary and source data are hashed into the same buckets, making it possible for loading only piece of dictionary bucket to encode source data.</li> -</ul> - -<p>As you can see on the right, after upgradation to Kylin 4, cubing job changes from ten steps to two steps, the performance improvement of the construction is very obvious.</p> - -<h3 id="query-engine">Query engine</h3> -<p><img src="/images/blog/youzan/4 kylin4_query.png" alt="" /></p> - -<p>Next is the new query engine of Kylin 4. As you can see, the calculation of Kylin on HBase is completely dependent on the coprocessor of HBase and query server process. When the data is read from HBase into query server to do aggregation, sorting, etc, the bottleneck will be restricted by the single point of query server. But Kylin 4 is converted to a fully distributed query mechanism based on Spark, whatâs more, it âs able to do configuration tuning automatically in spark query step !</p> - -<h2 id="how-to-optimize-performance-of-kylin-4">03 How to optimize performance of Kylin 4</h2> -<p>Next, Iâd like to share some performance optimizations made by Youzan in Kylin 4.</p> - -<h3 id="optimization-of-query-engine">Optimization of query engine</h3> -<p>#### 1.Cache Calcite physical plan<br /> -<img src="/images/blog/youzan/5 cache_calcite_plan.png" alt="" /></p> - -<p>In Kylin4, SQL will be analyzed, optimized and do code generation in calcite. This step takes up about 150ms for some queries. We have supported PreparedStatementCache in Kylin4 to cache calcite plan, so that the structured SQL donât have to do the same step again. With this optimization it saved about 150ms of time cost.</p> - -<h4 id="tunning-spark-configuration">2.Tunning spark configuration</h4> -<p><img src="/images/blog/youzan/6 tuning_spark_configuration.png" alt="" /></p> - -<p>Kylin4 uses spark as query engine. As spark is a distributed engine designed for massive data processing, itâs inevitable to loose some performance for small queries. We have tried to do some tuning to catch up with the latency in Kylin on HBase for small queries.</p> - -<p>Our first optimization is to make more calculations finish in memory. The key is to avoid data spill during aggregation, shuffle and sort. Tuning the following configuration is helpful.</p> - -<ul> - <li>1.set <code class="highlighter-rouge">spark.sql.objectHashAggregate.sortBased.fallbackThreshold</code> to larger value to avoid HashAggregate fall back to Sort Based Aggregate, which really kills performance when happens.</li> - <li>2.set <code class="highlighter-rouge">spark.shuffle.spill.initialMemoryThreshold</code> to a large value to avoid to many spills during shuffle.</li> -</ul> - -<p>Secondly, we route small queries to Query Server which run spark in local mode. Because the overhead of task schedule, shuffle read and variable broadcast is enlarged for small queries on YARN/Standalone mode.</p> - -<p>Thirdly, we use RAM disk to enhance shuffle performance. Mount RAM disk as TMPFS and set spark.local.dir to directory using RAM disk.</p> - -<p>Lastly, we disabled sparkâs whole stage code generation for small queries, for sparkâs whole stage code generation will cost about 100ms~200ms, whereas itâs not beneficial to small queries which is a simple project.</p> - -<h4 id="parquet-optimization">3.Parquet optimization</h4> -<p><img src="/images/blog/youzan/7 parquet_optimization.png" alt="" /></p> - -<p>Optimizing parquet is also important for queries.</p> - -<p>The first principal is that weâd better always include shard by column in our filter condition, for parquet files are shard by shard-by-column, filter using shard by column reduces the data files to read.</p> - -<p>Then look into parquet files, data within files are sorted by rowkey columns, that is to say, prefix match in query is as important as Kylin on HBase. When a query condition satisfies prefix match, it can filter row groups with columnâs max/min index. Furthermore, we can reduce row group size to make finer index granularity, but be aware that the compression rate will be lower if we set row group size smaller.</p> - -<h4 id="dynamic-elimination-of-partitioning-dimensions">4.Dynamic elimination of partitioning dimensions</h4> -<p>Kylin4 have a new ability that the older version is not capable of, which is able to reduce dozens of times of data reading and computing for some big queries. Itâs offen the case that partition column is used to filter data but not used as group dimension. For those cases Kylin would always choose cuboid with partition column, but now it is able to use different cuboid in that query to reduce IO read and computing.</p> - -<p>The key of this optimization is to split a query into two parts, one of the part uses all segmentâs data so that partition column doesnât have to be included in cuboid, the other part that uses part of segments data will choose cuboid with partition dimension to do the data filter.</p> - -<p>We have tested that in some situations the response time reduced from 20s to 6s, 10s to 3s.</p> - -<p><img src="/images/blog/youzan/8 Dynamic_elimination_of_partitioning_dimensions.png" alt="" /></p> - -<h3 id="optimization-of-build-engine">Optimization of build engine</h3> -<p>#### 1.cache parent dataset<br /> -<img src="/images/blog/youzan/9 cache_parent_dataset.png" alt="" /></p> - -<p>Kylin build cube layer by layer. For a parent layer with multi cuboids to build, we can choose to cache parent dataset by setting kylin.engine.spark.parent-dataset.max.persist.count to a number greater than 0. But notice that if you set this value too small, it will affect the parallelism of build job, as the build granularity is at cuboid level.</p> - -<h2 id="practice-of-kylin-4-in-youzan">04 Practice of Kylin 4 in Youzan</h2> -<p>After introducing Youzanâs experience of performance optimization, letâs share the optimization effect. That is, Kylin 4âs practice in Youzan includes the upgrade process and the performance of online system.</p> - -<h3 id="upgrade-metadata-to-adapt-to-kylin-4">Upgrade metadata to adapt to Kylin 4</h3> -<p>First of all, for metadata for Kylin 3 which stored on HBase, we have developed a tool for seamless upgrading of metadata. First of all, our metadata in Kylin on HBase is stored in HBase. We export the metadata in HBase into local files, and then use tools to transform and write back the new metadata into MySQL. We also updated the operation documents and general principles in the official wiki of Apache Kylin. For more details, you can refer to: <a href="https://wiki.apache.org/confluence/display/KYLIN/How+to+migrate+metadata+to+Kylin+4">How to migrate metadata to Kylin 4</a>.</p> - -<p>Letâs give a general introduction to some compatibility in the whole process. The project metadata, tables metadata, permission-related metadata, and model metadata do not need be modified. What needs to be modified is the cube metadata, including the type of storage and query used by Cube. After updating these two fields, you need to recalculate the Cube signature. The function of this signature is designed internally by Kylin to avoid some problems caused by Cube after Cube is determined.</p> - -<h3 id="performance-of-kylin-4-on-youzan-online-system">Performance of Kylin 4 on Youzan online system</h3> -<p><img src="/images/blog/youzan/10 commodity_insight.png" alt="" /></p> - -<p>After the migration of metadata to Kylin4, letâs share the qualitative changes and substantial performance improvements brought about by some of the promising scenarios. First of all, in a scenario like Commodity Insight, there is a large store with several hundred thousand of commodities. We have to analyze its transactions and traffic, etc. There are more than a dozen precise precisely count distinct measures in single cube. Precisely count distinct measure is actually very inefficient if it is not optimized through pre-calculation and Bitmap. Kylin currently uses Bitmap to support precisely count distinct measure. In a scene that requires complex queries to sort hundreds of thousands of commodities in various UV(precisely count distinct measure), the RT of Kylin 2 is 27 seconds, while the RT of Kylin 4 is reduced from 27 seconds to less than 2 seconds.</p> - -<p>What I find most appealing to me about Kylin 4 is that itâs like a manual transmission car, you can control its query concurrency at your will, whereas you canât change query concurrency in Kylin on HBase freely, because its concurrency is completely tied to the number of regions.</p> - -<h3 id="plan-for-kylin-4-in-youzan">Plan for Kylin 4 in Youzan</h3> -<p>We have made full test, fixed several bugs and improved apache KYLIN4 for several months. Now we are migrating cubes from older version to newer version. For the cubes already migrated to KYLIN4, its small queriesâ performance meet our expectations, its complex query and build performance did bring us a big surprise. We are planning to migrate all cubes from older version to Kylin4.</p> -</description> - <pubDate>Thu, 17 Jun 2021 08:00:00 -0700</pubDate> - <link>http://kylin.apache.org/blog/2021/06/17/Why-did-Youzan-choose-Kylin4/</link> - <guid isPermaLink="true">http://kylin.apache.org/blog/2021/06/17/Why-did-Youzan-choose-Kylin4/</guid> - - - <category>blog</category> - - </item> - - <item> <title>ä½ ç¦»å¯è§åé ·ç«å¤§å±åªå·®ä¸å¥ Kylin + Davinci</title> <description><p>Kylin æä¾ä¸ BI å·¥å ·çæ´åè½åï¼å¦ Tableauï¼PowerBI/Excelï¼MSTRï¼QlikSenseï¼Hue å SuperSetãä½å°±å¯è§åå·¥å ·èè¨ï¼Davinci è¯å¥½çäº¤äºæ§å个æ§åçå¯è§å大å±å±ç°ææï¼ä½¿å ¶ä¸ Kylin çç»åè½è®©å¤§é¨åç¨æ·ææ´å¥½çå¯è§ååæä½éªã</p> @@ -1394,304 +1754,6 @@ if (assignments.getPartitionsByReplicaSe <category>blog</category> - - </item> - - <item> - <title>Use Python for Data Science with Apache Kylin</title> - <description><p>Original from <a href="https://kyligence.io/blog/use-python-for-data-science-with-apache-kylin/">Kyligence tech blog</a></p> - -<p>In todayâs world, Big Data, data science, and machine learning analytics and are not only hot topics, theyâre also an essential part of our society. Data is everywhere, and the amount of digital data that exists is growing at a rapid rate. According to <a href="https://www.forbes.com/sites/tomcoughlin/2018/11/27/175-zettabytes-by-2025/#622d803d5459">Forbes</a>, around 175 Zettabytes of data will be generated annually by 2025.</p> - -<p>The economy, healthcare, agriculture, energy, media, education and all other critical human activities rely more and more on the advanced processing and analysis of large quantities of collected data. However, these massive datasets pose a real challenge to data analytics, data mining, machine learning and data science.</p> - -<p>Data Scientists and analysts have often expressed frustration while trying to work with Big Data. The good news is that there is a solution: Apache Kylin. Kylin solves this Big Data dilemma by integrating with Python to help analysts &amp; data scientists finally gain unfettered access to their large-scale (terabyte and petabyte) datasets.</p> - -<h2 id="machine-learning-challenges">Machine Learning Challenges</h2> - -<p>One of the main challenges machine learning (ML) engineers and data scientists encounter when running computations with Big Data comes from the principle that higher volume or scale equates to greater computational complexity.</p> - -<p>Consequently, as datasets scale up, even trivial operations can become costly. Moreover, as data volume rises, algorithm performance becomes increasingly dependent on the architecture used to store and move data. Parallel data structures, data partitioning and placement, and data reuse become more important as the amount of data one is working with grows.</p> - -<h2 id="what-apache-kylin-is-and-how-it-helps">What Apache Kylin Is and How It Helps</h2> - -<p>Apache Kylin is an open source distributed Big Data analytics engine designed to provide a SQL interface for multi-dimensional analysis (MOLAP) on Hadoop. It allows enterprises to rapidly analyze their massive datasets in a fraction of the time it would take using other approaches or Big Data analytics tools.</p> - -<p>With Apache Kylin, data teams are able to dramatically cut down on analytics processing time and associated IT and ops costs. Itâs able to do this by pre-computing large datasets into one (or another very small amount) of OLAP cubes and storing them in a columnar database. This allows ML Engineers, data scientists, and analysts to quickly access the data and perform data mining activities to uncover hidden trends easily.</p> - -<p>The Following diagram illustrates how machine learning and data science activities on big data become much easier when Apache Kylin is introduced.</p> - -<p><img src="/images/blog/python-data-science/diagram1.png" alt="diagram1" /></p> - -<h2 id="how-to-integrate-python-with-apache-kylin">How to Integrate Python with Apache Kylin</h2> - -<p>Python has quickly risen in prominence to take its spot as one of the leading programming languages in the data analytics field (as well as outside the field). With its ease of use and extensive collection of libraries, Python has become well-positioned to take on Big Data.</p> - -<p>Python also provides plenty of data mining tools to assist in the handling of data, offering up a variety of applications already adopted by the machine learning and data science communities. Simply put, if youâre working with Big Data, thereâs probably a way Python can make your job easier.</p> - -<p>Apache Kylin can be easily integrated with Python with support from <a href="https://github.com/Kyligence/kylinpy">Kylinpy</a>. Kylinpy is a python library that provides a SQLAlchemy Dialect implementation. Thus, any application that uses SQLAlchemy can now query Kylin OLAP cubes. Additionally, it also allows users to access data via Pandas data frames.</p> - -<p><strong>Sample code to access data via Pandas:</strong></p> - -<div class="highlighter-rouge"><pre class="highlight"><code>$ python - - &gt;&gt;&gt; import sqlalchemy as sa - &gt;&gt;&gt; import pandas as pd - &gt;&gt;&gt; kylin_engine = sa.create_engine('kylin://&lt;username&gt;:&lt;password&gt;@&lt;IP&gt;:&lt;PORT&gt;/&lt;project_name&gt;', -â connect_args={'is_ssl': True, 'timeout': 60}) - &gt;&gt;&gt; sql = 'select * from kylin_sales limit 10' - &gt;&gt;&gt; dataframe = pd.read_sql(sql, kylin_engine) - &gt;&gt;&gt; print(dataframe) -</code></pre> -</div> - -<p><strong>Benefits of using Apache Kylin as Data Source:</strong></p> -
[... 249 lines stripped ...]