当前位置: 首页>数据库>正文

开源分布式图数据库的思考和实践

鏈枃棣栧彂浜?Nebula Graph Community 鍏紬鍙?/strong>

鏈枃鏁寸悊鑷?DTCC 涓婚婕旇銆愬紑婧愬垎甯冨紡鍥炬暟鎹簱鐨勬€濊€冨拰瀹炶返銆?/p>

鐩綍

鐩綍

  • 鍥炬暟鎹簱甯傚満鐨勭幇鐘?/li>
  • 鍥炬暟鎹簱鐨勪紭鍔?/li>
  • 浠?Nebula Graph 涓轰緥
  • 寮€婧愮ぞ鍖?/li>

鍥炬暟鎹簱甯傚満鐨勭幇鐘?/h2>

寮€绡囦箣鍓嶏紝鍏堝洖椤句笅鍥炬暟鎹簱甯傚満鍙樺寲锛?018 骞村墠甯傚満澶ф鏄?$ 650,000,000锛屾牴鎹洰鍓嶅競鍦虹殑鐮旂┒鎶ュ憡锛屽浘鏁版嵁搴撳競鍦哄皢鍦ㄦ湭鏉ョ殑 4 骞翠互骞村闀?30%~100% 鐨勯€熷害杈惧埌 $ 4,130,000,000~$ 8,000,000,000銆?/p>

开源分布式图数据库的思考和实践,第1张
dtcc-01.png

鑰屾暣涓浘鏁版嵁搴撳競鍦虹殑鍙戝睍锛屼粠鍏紑璧勬枡涓婃潵鐪嬶紝Graph Database锛堝浘鏁版嵁搴擄級 姒傚康鏈€鏃╂槸 Gartner 鍦?2013 骞存彁鍑虹殑銆傝€屽綋鏃舵瘮杈冮噸瑕佺殑 2 涓弬涓庤€呮槸鈥斺€擭eo4j 鍜?TitanDB锛屽悗鑰呰鏀惰喘鍚庤癁鐢熶簡 JanusGraph銆備竴鑸潵璇翠竴涓簨鐗╁彂灞曞埌涓€瀹氶樁娈典細寮€濮嬭蛋涓嬪潯璺紝涓嶈繃鍥鹃鍩熺洰鍓嶆潵璇磋繕鏄浜庤摤鍕冨彂灞曢樁娈碉紝鍦?2021 骞?Gartner 鐨勬暟鎹拰鍒嗘瀽鍗佸ぇ瓒嬪娍涓紝鍥捐繕鏄崰鏈変竴甯箣鍦般€侴raph relate everything锛岀浉姣斾紶缁熸暟鎹簱锛屽畠鐨勬嫇灞曡寖鍥存洿澶э紝鍖呮嫭锛氬浘璁$畻銆佸浘澶勭悊銆佸浘娣卞害瀛︿範銆佸浘鏈哄櫒妯″瀷绛夌瓑銆?/p>

![dtcc-02.png](https://upload-images.jianshu.io/upload_images/18897496-37e97adf5d81360b.png?imageMogr2/auto-orient/st

开源分布式图数据库的思考和实践,第2张
dtcc-03.png

rip%7CimageView2/2/w/1240)

涓嬮潰杩欏紶鍥炬槸鍋氭暟鎹簱鎺掑悕鐨?DB-Engine 缁欏嚭鐨勬暟鎹簱澧為暱瓒嬪娍锛屽彲浠ヨ鍒板浘鏁版嵁搴撴槸杩?10 骞存潵鍏虫敞搴﹀闀挎渶蹇殑鏁版嵁搴撱€傝〃鐨勬暟鎹潵婧愪簬绀句氦濯掍綋锛屼緥濡傦細LinkedIn銆乀witter 鎻愬強鏌愪釜鎶€鏈偣鐨勬鏁帮紝浠ュ強 Stack Overflow 涓婇潰鐩稿叧闂鏁般€佹悳绱㈠紩鎿庢悳绱㈣秼鍔裤€?/p>

鍥炬暟鎹簱鐨勪紭鍔?/h2>

涓€鑸潵璇达紝鍥剧浉瀵瑰埆鐨勬暟鎹簱锛屾渶鏄庢樉鐨勪紭鍔夸究鏄洿瑙傘€備笅闈㈡槸涓€涓潈鍔涙父鎴忎汉鐗╁叧绯荤殑琛ㄧ粨鏋勫浘鍜屽浘缁撴瀯鍥撅細

开源分布式图数据库的思考和实践,第3张
dtcc-04.png

锛堣〃缁撴瀯锛?/p>

开源分布式图数据库的思考和实践,第4张
dtcc-05.png

锛堝浘缁撴瀯锛?/p>

杩樻湁涓€涓槸琛ㄨ揪绠€娲侊紝鍦ㄥ悓鏍风殑鏁版嵁妯″瀷锛堜笅鍥撅級

开源分布式图数据库的思考和实践,第5张
dtcc-06.png

瀹炵幇锛氭壘涓€瀹氱殑鏃堕棿鑼冨洿鍐咃紝鎬诲叡鍙戜簡澶氬皯 posts锛屽悇鑷鍥炲澶氬皯娆″苟瀵圭粨鏋滆繘琛屾帓搴忥紝SQL 鐨勭紪鍐欏彲鑳芥槸杩欐牱鐨勶細

--PostgreSQL 

WITH RECURSIVE post_all (psa_threadid

                      , psa_thread_creatorid, psa_messageid

                      , psa_creationdate, psa_messagetype

                       ) AS (

    SELECT m_messageid AS psa_threadid

         , m_creatorid AS psa_thread_creatorid

         , m_messageid AS psa_messageid

         , m_creationdate, 'Post'

      FROM message

     WHERE 1=1 AND m_c_replyof IS NULL -- post, not comment

       AND m_creationdate BETWEEN :startDate AND :endDate

  UNION ALL

    SELECT psa.psa_threadid AS psa_threadid

         , psa.psa_thread_creatorid AS psa_thread_creatorid

         , m_messageid, m_creationdate, 'Comment'

      FROM message p, post_all psa

     WHERE 1=1 AND p.m_c_replyof = psa.psa_messageid

     AND m_creationdate BETWEEN :startDate AND :endDate

)

SELECT p.p_personid AS "person.id"

     , p.p_firstname AS "person.firstName"

     , p.p_lastname AS "person.lastName"

     , count(DISTINCT psa.psa_threadid) AS threadCount

END) AS messageCount

     , count(DISTINCT psa.psa_messageid) AS messageCount

  FROM person p left join post_all psa on (

       1=1   AND p.p_personid = psa.psa_thread_creatorid

   AND psa_creationdate BETWEEN :startDate AND :endDate

   )

 GROUP BY p.p_personid, p.p_firstname, p.p_lastname

 ORDER BY messageCount DESC, p.p_personid

 LIMIT 100;

鐢?Cypher锛堝浘鏌ヨ璇█锛夎〃杈剧殑璇濓紝浠呯敤涓嬮潰璇彞鍗冲彲锛?/p>

--Cypher
MATCH (person:Person)<-[:HAS_CREATOR]-(post:Post)<-[:REPLY_OF*0..]-(reply:Message)
WHERE  post.creationDate >= $startDate   AND  post.creationDate <= $endDate
  AND reply.creationDate >= $startDate   AND reply.creationDate <= $endDate
person. RETURN
id,   person.firstName,   person.lastName,   count(DISTINCT post) AS threadCount,
  count(DISTINCT reply) AS messageCount
ORDER BY
  messageCount DESC,  person.id ASC
LIMIT 100

鍦ㄦ煡璇㈣繖鍧楋紝鍥炬煡璇㈢殑琛ㄨ揪鏂瑰紡鏇寸畝娲併€?/p>

姝ゅ锛屽浘鏈韩鐨勭敓鎬佷篃鐩稿綋涓板瘜锛屼笅闈负 2020 骞寸殑鍥炬妧鏈叏鏅浘锛岃€屽湪 2021 骞存柊澧炵殑鎶€鏈偣浼氭洿澶氥€?/p>

开源分布式图数据库的思考和实践,第6张
dtcc-07.jpeg

浠?Nebula Graph 涓轰緥

涓嬮潰浠?Nebula 涓轰緥锛屼粙缁嶄笅鍒嗗竷寮忓浘鏁版嵁搴?Nebula Graph 鐗规€э紝浠ュ強寮€鍙戣繃绋嬩腑閬囧埌浣曠鎶€鏈寫鎴樸€佺爺鍙戝洟闃熷張鏄浣曞鐞嗚繖绉嶆妧鏈寫鎴樸€?/p>

鍦?19 骞?5 鏈堝簳寮€婧愪箣鍓嶏紝18 骞村勾搴曞紑濮嬭璁?Nebula Graph 闆忓舰鏃讹紝鐮斿彂鍥㈤槦瀹氫簡 4 涓洰鏍囷細瑙勬ā銆佺敓浜с€丱LTP銆佸紑婧愮敓鎬侊紝鑰岃繖 4 涓洰鏍囩洿鑷充粖鏃ヤ緷鏃у奖鍝?Nebula Graph 浜у搧瑙勫垝銆?/p>

Nebula Graph 璁捐鐨勭涓€涓鐐规槸锛?strong>瑙勬ā锛屽悓鍏朵粬绔炲搧璁捐鍒濊》涓嶅ぇ涓€鏍凤紝Nebula Graph 涓€寮€濮嬭璁℃椂锛岃€冭檻鍒版暟鎹簱鏈潵澶勭悊鐨勬暟鎹妯′竴瀹氫細寰堝ぇ鈥斺€旀懇灏斿畾鐞嗘€绘槸蹇笉杩囨暟鎹闀匡紝鑰屽崟鏈烘儏鍐靛苟涓嶈兘寰堝ソ鍦板簲瀵规捣閲忔暟鎹互鍙婃湭鏉ョ殑鏁版嵁澧為暱锛岀户鑰岃浆鍚戠爺绌跺垎甯冨紡鏁版嵁搴撴槸濡備綍澶勭悊鏁版嵁銆傛墍浠ヨ锛孨ebula Graph 鐨勮璁℃槸閽堝鐢熶骇宸ヤ笟绾у埆鐨勬暟鎹噺锛氫竾浜跨偣杈规暟鎹噺銆傚湪鏁版嵁瑙勬ā澶х殑鎯呭喌涓嬶紝鏁翠釜鍥炬暟鎹垎鏋愬睘鎬у緱澶氾紝涓嶅悓浜庡彟澶栦竴绉嶅彧鍋氬浘缁撴瀯銆佷笉鍋氬浘灞炴€х殑鍥炬暟鎹簱璁捐锛孨ebula Graph 寮€濮嬬殑璁捐渚挎槸锛氬ぇ瑙勬ā鐨勫睘鎬у浘锛屾敮鎸佷笂鐧惧睘鎬э紝鐢ㄦ埛鍙湪鍏蜂綋鍦烘櫙涓婅惤鍦?Nebula Graph 瀹炶返銆?/p>

绗簩鐐规槸鐢熶骇锛岄櫎浜嗙涓€鐐规彁鍒扮殑宸ヤ笟绾у埆鍙敤涔嬪锛岃繕鏈夋煡璇㈣瑷€濡備綍璁捐銆佸彲瑙嗗寲銆佸彲缂栫▼銆佽繍缁磋姹傘€?/p>

绗笁鐐规槸 OLTP锛屽綋鏃剁殑璁捐鐩爣浼樺厛鑰冭檻 TP 鍦烘櫙锛屽嵆浣垮埌浠婂ぉ涔熸槸涓€鏍凤紝Nebula Graph 鏄竴涓潪甯稿叧娉?TP 鍦烘櫙鐨勫浘鏁版嵁搴擄紝鍗筹細瀹冩槸涓€涓湪绾裤€侀珮骞跺彂銆佷綆寤惰繜鐨勫浘鏁版嵁搴撱€備竴鑸潵璇翠簰鑱旂綉鐨勪笟鍔″満鏅杩欏潡鐨勯渶姹傛瘮杈冨锛屾瘮濡傝浣犵殑涓€绗旇浆璐︿氦鏄撴敮浠樻椂锛岀郴缁熷彲鑳借妫€娴嬩竴涓嬫槸鍚﹀畨鍏紝杩欎釜澶勭悊鏃堕棿鍙兘鏄嚑鍗佹绉掑乏鍙炽€?/p>

鏈€鍚庝竴鐐?strong>寮€婧?/strong>锛岄櫎浜嗘瀯寤烘妧鏈ぞ鍖恒€佸紑鍙戣€呯敓鎬佷箣澶栵紝涓昏杩樿€冭檻浜嗗鎺ュ叾浠栧ぇ鏁版嵁鐢熸€侊紝浠ュ強鍚屽浘璁$畻銆佽缁冩鏋惰繘琛岀粨鍚堛€?/p>

开源分布式图数据库的思考和实践,第7张
dtcc-08.png

杩欐槸鐩墠 Nebula Graph 鐨勭敓鎬佸浘锛岀孩鑹蹭负鍐呮牳閮ㄥ垎锛屽垎涓?meta銆乬raph銆乻torage 涓変釜妯″潡锛屼笅鏂囦細璇︾粏璁茶В銆傚唴鏍搁儴鍒嗕笂灞備负鏌ヨ璇█锛岄櫎浜嗚嚜鐮旂殑 nGQL 涔嬪锛岃繕鍏煎浜?openCypher銆傚啀涓婂眰涓哄鎴风锛岀洰鍓嶆敮鎸?Java銆丆++銆丳ython銆丟o 绛夌瓑璇█銆傝€屽鎴风涓婂眰涓哄彲缂栫▼ SDK锛屾渶涓婂眰涓哄ぇ鏁版嵁鐢熸€佹敮鎸佸眰锛屾瘮濡傚父瑙佺殑 Spark銆丗link锛屽浘璁$畻 GraphX銆丳lato锛岃繕鏈夊叾浠栨暟鎹簮杩佺Щ宸ュ叿銆傚乏渚т负浜戦儴缃层€佸彲瑙嗗寲銆佺洃鎺фā鍧楋紝鍙充晶涓昏渚ч噸鏁版嵁瀹夊叏锛屾瘮濡傝锛氭暟鎹浠姐€佸鏈烘埧閮ㄧ讲鈥︼紝杩樻湁鍚屽伐绋嬬浉鍏崇殑 Chaos 浠ュ強鎬ц兘鍘嬫祴锛屾渶鍙充晶鏄ぞ鍖哄拰寮€鍙戣€呯浉鍏崇殑鍐呭銆?/p>

开源分布式图数据库的思考和实践,第8张
dtcc-09.png

鏉ヨ缁嗚杩颁笅 Nebula 鏍稿績璁捐锛屼富瑕佸寘鎷?meta銆乬raph銆乻torage锛屽彸涓婅鐨?meta 涓昏鏄厓鏁版嵁锛屼腑闂寸殑 graph 鏄煡璇㈠紩鎿庨儴鍒嗭紝涓嬮潰鐨?storage 鏄瓨鍌ㄥ紩鎿庯紝杩欎笁涓ā鍧楄繘绋嬪垎绂伙紝瀛樺偍璁$畻鍒嗙鐨勮璁′篃浣撶幇浜嗕箣鍓嶈鍒扮殑 Nebula Graph 璁捐涔嬪垵鑰冭檻瑙勬ā澶ц繖涓€鐐广€?/p>

璇︾粏鍦版潵璇达紝鍏冩暟鎹ā鍧楋紙Meta Service锛変富瑕佺敤浜庣鐞?Schema锛孨ebula Graph 鐨?Schema 涓嶆槸瀹屽叏 Schema freee 鐨勮璁★紝涓昏浣撶幇涓虹偣鍜岃竟鐨勫睘鎬ф槸闇€瑕侀鍏堝畾涔夈€傛澶栵紝space 绠$悊銆佹潈闄愮鐞嗐€侀暱鑰楁椂浠诲姟绠$悊銆佹暟鎹竻鐞嗙瓑绛夌鐞嗛兘鏄湪 meta 妯″潡杩涜銆傚湪鍏蜂綋浣跨敤涓紝meta 涓€鑸儴缃?3 涓妭鐐癸紝杩?3 涓妭鐐硅繘琛屽己鍚屾銆?strong>瀛樺偍寮曟搸灞?Storage Service 鏄杩涚▼绯荤粺锛屽涓繘绋嬩箣闂村仛涓€涓己鍚屾銆?/p>

涓婃枃璇村埌 Nebula 鏀寔涓囦嚎瑙勬ā鐨勭偣杈规暟鎹噺锛岃偗瀹氳瀵瑰浘鍒囩墖銆備竴鑸潵璇村浘鍒囩墖鍒嗕负涓ょ锛?code>鍒囩偣銆?code>鍒囪竟銆侼ebula Graph 鐨勮璁℃槸鍒囪竟锛屽皢鐐规斁鍦?Partition 涓婏紝杈圭殑鍑鸿竟鍜屽叆杈逛篃鏀惧湪鍚勮嚜鐨?Partition 涓婏紝鐒跺悗鎶婅繖涓垏鎴?100 鐢氳嚦 1000 涓?Partition 閮藉彲浠ワ紝Partition 鏄粏绮掑害妯″潡锛屾湇鍔′簬姣忎釜杩涚▼銆傛瘡涓?Partition锛屾瘮濡?Partition 1 鍙兘浼氭湁 3 鍓湰锛岃惤鍦ㄤ笉鍚岀殑鏈哄櫒涓婏紝Partition 2 钀藉湪涓嶅悓鐨?3 鍙版満鍣ㄤ笂锛屾瘡涓?Partition 鍐呴儴淇濇寔寮轰竴鑷达紝濡傛灉瑕佽繘琛岃皟搴︼紝灏嗘煇涓?Partition 绉诲紑銆?/p>

瀛樺偍寮曟搸涓婇潰鏄煡璇㈠紩鎿庡眰锛?strong>鏌ヨ寮曟搸鏄棤鐘舵€佺殑锛屽嵆锛氭墍鏈夋暟鎹?Graph Service 瑕佷箞浠?meta 鎷夊厓鏁版嵁锛岃涔堝幓 storage 鎷変富鏁版嵁銆傛煡璇㈠紩鎿庢湰韬笉瀛樺湪鐘舵€侊紝寮曟搸鐩镐簰涔嬮棿涓嶅瓨鍦ㄩ€氫俊锛屾煇涓煡璇㈣繃鏉ュ彧浼氳惤鍒版煇涓?graphd 涓婏紝鑰岃繖涓?graphd 浼氳惤鍒板涓?storaged 涓娿€?/p>

浠ヤ笂灏辨槸 Nebula Graph 瀛樺偍璁$畻鍒嗙鏋舵瀯璁茶В銆?/p>

涓嬮潰涓烘暟鎹壒鎬э紝涓婃枃璇磋繃 Nebula Graph 涓哄睘鎬у浘锛岃櫧鐒剁偣鍜岃竟鐨勮繛鎺ュ叧绯诲急锛屼絾鏄湰韬偣杈硅嚜涓嫢鏈変粈涔堝睘鎬ф槸 DDL 棰勫厛瀹氫箟濂界殑锛屽綋鐒朵綘鍙互璁剧疆澶氱増鏈?Schema銆傚湪 Nebula Graph 涓О鐐圭被鍨嬩负 Tag锛岃竟绫诲瀷涓?EdgeType锛岀偣鍙互杩炴帴澶氭潯杈广€傜敤鎴蜂娇鐢?Nebula Graph 闇€瑕侀鍏堟寚瀹氬敮涓€鏍囪瘑锛屾瘮濡?int64 鎴栬€呭畾闀?string锛岀偣閫氬父浣夸簩鍏冪粍鏉ユ爣璇嗭紝鍗筹細string vid 鍔犱笂鐐圭被鍨?tag銆傝竟鍒欑敤鍥涘厓缁勬潵鏍囪瘑锛屽嵆锛氳捣鐐广€佽竟绫诲瀷銆乺ank 鍜岀粓鐐癸紝鎵€浠ュ鏋滆鍙?ID 鐨勮瘽锛屼細鍙栧嚭鏉ヤ簩鍏冪粍鎴栬€呭洓鍏冪粍銆?/p>

鍦ㄦ暟鎹被鍨嬫柟闈紝甯歌鐨?Boolean銆両nt銆丏ouble 涔嬬被鐨勬暟鎹被鍨嬶紝鎴栬€呮槸缁勫悎绫诲瀷 List銆丼et锛屾垨鑰呮槸鍥惧父瑙?Path銆丼ubgraph 绫诲瀷閮芥敮鎸併€傚湪鏁版嵁灞炴€т腑鍙兘浼氬瓨鍦ㄩ暱鏂囨湰锛屼竴鑸潵璇翠氦缁?Elasticsearch 杩涜鏂囨湰绱㈠紩澶勭悊銆?/p>

杩欓噷瀵逛箣鍓嶇殑瀛樺偍寮曟搸杩涜琛ュ厖璇存槑锛屽澶栧浜庢煡璇㈠紩鎿?graphd 鑰岃█锛屽瓨鍌ㄥ紩鎿庢毚闇茬殑瀵瑰鎺ュ彛灏辨槸鍒嗗竷寮忓浘鏈嶅姟锛屼絾濡傛灉闇€瑕佺殑璇濓紝涔熻兘鏆撮湶涓轰竴涓垎甯冨紡 KV 鏈嶅姟銆傚湪瀛樺偍寮曟搸涓紝Partition 閲囩敤澶氭暟娲句竴鑷存€у崗璁?Raft銆傚湪 Nebula Graph 涓偣杈规槸鍒嗗尯瀛樺偍锛岃繖閲岃瑙d笅 KV 瀹炵幇鍒嗗尯瀛樺偍鍘熺悊锛?/p>

开源分布式图数据库的思考和实践,第9张
dtcc-10.png

涓婂浘鏄竴涓畝鍗曠殑鍥撅細璧风偣銆佽竟銆佺粓鐐癸紝鐜板湪鐢?KV 寤烘ā锛屼笂闈㈡槸璧风偣 K 鐨勫缓妯★紝涓嬮潰鏄粓鐐?K 鐨勫缓妯★紝Value 閮ㄥ垎鏄簭鍒楀寲灞炴€с€備笂闈緥瀛愬皢璧风偣鍜岀粓鐐瑰仛鎴愪簡 2 涓?K锛屼竴鑸潵璇村嚭鐜颁笁涓浘鍏冪礌锛堜袱涓偣鍔犱竴鏉¤竟锛夛紝鏁版嵁瀛樺偍浼氳惤鍦?2 涓笉鍚岀殑 Partition 涓婏細鍑鸿竟鍜岃捣鐐瑰瓨鍌ㄥ湪涓€鍧楋紝鍏ヨ竟鍜岀粓鐐瑰瓨鍌ㄥ湪涓€鍧椼€傝繖鏍疯璁$殑濂藉鍦ㄤ簬锛?strong>浠庤捣鐐瑰紑濮嬬殑骞垮害浼樺厛閬嶅巻鎵捐竟浼氶潪甯告柟渚匡紝鎴栬€呯粓鐐瑰紑濮嬭繘琛岄€嗗悜骞垮害閬嶅巻鎵惧嚭璧风偣涔熶細闈炲父鏂逛究銆?/p>

鎵€浠ヤ笂闈㈣鐨勫氨鏄浘鍒囪竟鎿嶄綔锛?/p>

开源分布式图数据库的思考和实践,第10张
dtcc-11.png

鍦?Nebula Graph 涓竴鏉¤竟瀛樺偍涓?2 浠芥暟鎹紝鍓嶉潰鎻愬強瀛樺偍灞備緷璧栦簬 VID锛屽熀浜?Raft 鍗忚淇濋殰寮轰竴鑷存€э紝鑰?Raft 涔熷彲浠ユ敮鎸?Listener 瑙掕壊鐢ㄦ潵灏嗘暟鎹悓姝ュ埌鍏朵粬杩涚▼銆?/p>

鍐嶆潵璁茶В涓?Nebula 鍔熻兘锛屾瘮濡傦細绱㈠紩鍔熻兘锛岀洰鍓?Nebula Graph 鐢?ES 鏉ュ仛鍏ㄦ枃绱㈠紩锛屽湪 v2.x 鐗堟湰寮€濮嬶紝鐮斿彂鍥㈤槦瀵?Nebula 绱㈠紩鐨勫啓鎬ц兘杩涜浜嗕紭鍖栥€傚湪 v2.5.0 寮€濮嬩篃鏀寔浜嗘暟鎹繃鏈?TTL 鍔熻兘鍜岀储寮曞姛鑳界殑缁勫悎浣跨敤銆傛澶栬繕鏈?TOSS 鍔熻兘锛屽湪 v2.6.0 鐗堟湰寮€濮嬶紝Nebula 鏀寔浜嗘鍙嶅悜杈圭殑鏈€缁堜竴鑷存€э紝鎻掑叆銆佷慨鏀硅竟鏃讹紝姝e弽杈硅涔堝悓鏃跺啓鍏ユ垚鍔燂紝瑕佷箞鍚屾椂鍐欏叆澶辫触銆?/p>

鍦ㄦ煡璇㈠紩鎿庡拰鏌ヨ璇█ nGQL 鏂归潰锛屽浘鏁版嵁搴撴煡璇㈣繖鍧楃洰鍓嶆槸娌℃湁缁熶竴鐨勬爣鍑嗭紝鐩墠涓昏鍒嗕负 2 涓祦娲撅細鐢?Neo4j銆乀igerGraph銆丱racle銆丟oogle銆丩DBC 缁勭粐鏈烘瀯姝e湪鎺ㄨ繘鐨?Graph Query Language 鐨勫浗闄呮爣鍑嗭紝涓昏鏄熀浜?ISO SQL 鏍囧噯涓婄殑鎵╁睍锛涗互鍙?Tinkerpop 鐨?Gremlin锛岃繖鏄?Apache 閭h竟鐨勬爣鍑嗭紝涓€鑸簯浜у晢鍜岀▼搴忓憳瀵规姣旇緝鎰熷叴瓒c€傜洰鍓嶆潵璇达紝鍏湀浠?IOS SQL 缁勭粐鐨勮崏绋挎枃鐚〃鏄?GQL 鏍囧噯鐨勮娉曞拰璇箟宸茬粡澶т綋纭畾锛屼富瑕佺殑鍑犱釜鏁版嵁搴撳巶鍟嗚揪鎴愪簡涓€鑷淬€備釜浜洪璁℃槑骞村彲浠ョ湅鍒板叕寮€鐨勬枃鏈€?/p>

鍐嶆潵璇翠笅 Nebula Graph 鐨勬暣涓浘鏌ヨ璇█ nGQL 鐨勬紨鍙橈紝鍦?v1.x 鐗堟湰涓紝鏌ヨ璇█鏄畬鍏ㄨ嚜鐮旂殑锛岀被浼?GO STEPS 杩欐牱椋庢牸锛屽涓瓙鍙ョ敤 PIPE 杩涜杩炴帴锛屾瘮濡備笅闈㈢殑渚嬪瓙锛?/p>

GO N TO M STEPS FROM $ids OVER $edge_type WHERE $filters | FETCH PROP

鍦?v2.x 寮€濮嬶紝nGQL 寮€濮嬪吋瀹?openCypher銆俹penCypher 鏄?Neo4j 鍦?17 骞村紑婧愪簡閮ㄥ垎鐨?Cypher 璇█锛岀洰鍓?nGQL 鏀寔 openCypher 鐨?DQL锛坱ranversal銆乸attern match锛夛紝鍦?DDL銆丏ML 杩欎簺鏂归潰锛寁2.x 鐗堟湰杩樻槸淇濈暀浜嗚嚜宸卞師鐢熺殑 nGQL 椋庢牸銆?/p>

涓婃枃鎻愬埌 Nebula Graph 鐨勫洓涓璁$洰鐨勬湁涓€涓偣鏄細鐢熶骇鍙敤锛屽湪杩愮淮杩欏潡灏卞緱鑰冭檻瀵瑰鍥剧┖闂磋繘琛屾暟鎹殧绂汇€佺敤鎴锋潈闄愰壌瀹氥€佸壇鏈嚜瀹氫箟銆乂ID 绫诲瀷涓嶅悓鈥︽澶栵紝鍦ㄩ泦缇ょ骇鍒彲浠ラ噰鐢ㄥ鏁版淳涓€鑷存€у崗璁疄鐜?CAP 涓殑 CP 鏂规锛屼篃鍙互璺ㄦ満鎴垮疄鏂?AP 鏂规銆傝繕鏈夎繍缁撮儴缃叉柟闈紝4 鏈堝簳鍙戝竷鐨?Nebula Operator 鏀寔浜?K8s銆傚湪杩愮淮鐩戞帶鏂归潰锛岄櫎浜?Nebula 鐮斿彂鍥㈤槦寮€鍙戠殑 Nebula Dashboard 涔嬪锛岀ぞ鍖虹殑鐢ㄦ埛涔熷湪涓嶅悓绋嬪害涓婂 Grafana銆丳rometheus 鍋氫簡鏀寔銆傛暟鎹垵濮嬪寲杩欏潡闈炲父涓板瘜锛屽洜涓?Nebula Graph 搴曞眰鐢ㄤ簡 RocksDB锛孯ocksDB 鍙互鐩存帴鍦?Spark 闆嗙兢涓婂皢搴曞眰鏁版嵁鏍煎紡绠楀ソ锛屾瘮濡傝锛屼綘鍦?300 鍙?Spark 鏈哄櫒涓畻濂芥暟鎹牸寮忥紝鍐嶅鍏?Nebula Graph 涓紝姣忎釜灏忔椂鍙互寰堝揩鍦版洿鏂颁竴鍗冧嚎鐐硅竟鏁版嵁銆?/p>

鍏充簬鎬ц兘閮ㄥ垎锛屽ぇ澶氭暟 Nebula 鎬ц兘娴嬭瘯閮芥槸绀惧尯鐢ㄦ埛锛屾瘮濡傜編鍥€佸井淇°€?60 閲戣瀺銆佸井浼楅摱琛屼箣绫荤殑鎶€鏈洟闃熷湪鍋氭€ц兘娴嬭瘯銆侼ebula Graph 鐨勬€ц兘娴嬭瘯鎶ュ憡锛屼竴鑸槸鑷韩鐗堟湰鎬ц兘瀵规瘮锛屽熀浜庡叕寮€鐨?LDBC_SNB_SF100 鏁版嵁闆嗭紝澶ф缁撴灉鍙互鍙傝€冧笅闈㈣繖鍑犲紶鍥撅細

开源分布式图数据库的思考和实践,第11张
dtcc-11.png

开源分布式图数据库的思考和实践,第12张
dtcc-12.png

鎬荤殑鏉ヨ锛屾繁搴﹂亶鍘嗘儏鍐典笅鎬ц兘鏈夋槑鏄炬彁鍗?/strong>銆?/p>

涓婃枃鎻愬埌 Nebula Graph 鐨勭涓変釜璁捐鐩爣鏄?OLTP锛岄偅涔堝浣曟弧瓒崇敤鎴风殑 AP 闇€姹傚憿锛熷湪杩欏潡 Nebula Graph 瀵规帴浜?Spark 鐨?Graph X锛屼互鍙婃敮鎸佽吘璁井淇″洟闃熷浘璁$畻寮曟搸 Plato銆傚湪 Plato 瀵规帴杩欏潡锛屽叾瀹炴槸涓ゅ寮曟搸鐨勬暟鎹墦閫氾紝闇€瑕佸皢 Nebula 鍐呴儴鐨勬暟鎹牸寮忓彉鎴?Plato 涓唴閮ㄧ殑鏁版嵁鏍煎紡锛孭artition 鍋氫竴涓€鏄犲皠锛岀浉鍏崇殑鏂囩珷灏嗗湪鍏紬鍙峰悗缁彂甯冦€?/p>

寮€婧愮ぞ鍖?/h2>

鏈€鍚庨儴鍒嗕负 Nebula Graph 鐨勭ぞ鍖烘儏鍐碉紝涓嬪浘涓?Nebula Graph 鐮斿彂鍟嗘鑻ユ暟缃戠殑涓€涓勾琛細

开源分布式图数据库的思考和实践,第13张
dtcc-13.png

Nebula Graph 椤圭洰鍦?19 骞?5 鏈堝紑婧愬苟鍙戝竷浜?Alpha 鐗堟湰锛?0 骞?6 鏈堝彂甯?1.0 GA 鐗堟湰锛岃櫧鐒朵箣鍓嶅凡缁忔湁浜涗紒涓氱敤鎴峰皢 Nebula Graph 搴旂敤浜庣敓浜х幆澧冦€傚湪浠婂勾 3 鏈堝彂甯冧簡绗簩涓ぇ鐗堟湰 v2.0 GA锛屽姣斾箣鍓嶇殑 1.x 鐗堟湰鏈€澶х殑鍖哄埆鏄敮鎸佷簡 openCypher銆備笂鏂囦篃鎻愬埌杩?DB-Engines 鎺掑悕锛孨ebula Graph 鍦?19 骞?12 鏈堣繘鍏ユ鍗曪紝褰撴椂鏄渶鍚庝竴鍚嶇洰鍓?2 骞翠箣鍚庝笂鍗囧埌 15 鍚嶏細

开源分布式图数据库的思考和实践,第14张
dtcc-14.png

鐒跺悗鏄浗鍐呯殑鏌愪釜澶у瀵瑰浗鍐呭紑婧愪骇鍝佽繘琛屼簡涓ぞ鍖虹儹搴︽帓鍚嶏紝Nebula Graph 鐮斿彂鍟嗘鑻ユ暟缃戯紙vesoft锛夋帓鍚嶇鍏€?/p>

开源分布式图数据库的思考和实践,第15张
dtcc-15.png

鏈€鍚庯紝璁蹭笅瀵瑰紑婧愮殑鎬濊€冿細鍏跺疄鍦ㄥ浘棰嗗煙锛屽紑婧愭槸涓€浠跺緢甯歌鐨勪簨锛屽弽鑰岄棴婧愬苟涓嶅父瑙併€傚洜涓哄浘鏈韩鍦ㄨ繃鍘诲嚑骞存槸涓皬棰嗗煙锛屽彧鏄渶杩戞參鎱㈠湴鐏捣鏉ャ€傛墍浠ワ紝閫夋嫨寮€婧愭槸涓€涓尯濂界殑 Branding锛屽缓绔嬭嚜宸辨妧鏈搧鐗岀殑鏂瑰紡銆傚啀鑰咃紝寮€婧愮殑鏂瑰紡鍙互鍚稿紩鏇村鐨勪汉鏉ョ敤瀹冿紝鍚屾洿澶氱殑浜轰氦娴佸浘鎶€鏈紝淇冭繘褰兼鎬濊€冦€備互鍙婏紝鍦ㄧ敤鎴蜂娇鐢ㄨ繃绋嬩腑锛屽弽棣堣繃鏉ョ殑浣跨敤寤鸿鑳借凯浠c€佸揩閫熷畬鍠勪骇鍝併€?/p>

QA

涓嬮潰鎽樺綍 DTCC 鐜板満鐢ㄦ埛鎻愰棶锛?/p>

Q锛氬浘鏁版嵁搴撳拰澶氭ā鏁版嵁搴撴槸鍐茬獊鐨勫悧锛熶簩鑰呯殑鍏崇郴鏄粈涔堬紵

A锛氱浉姣旀潵璇村妯℃暟鎹簱锛坢ulti-model锛夛紝鍥炬暟鎹簱鏈€澶х殑鐗圭偣鏄湪浜庡畠鐨勫叏鍏宠仈锛屽浣曞疄鐜板璺虫煡璇€傚搴斿埌鏁版嵁搴撹璁$殑璇濓紝灏辨槸鑰冭檻搴曞眰瑕佸仛鎴愪竴涓粈涔堟牱鐨勬暟鎹牸寮忥紝鏁版嵁鍜岃绠楁€庝箞鏀惧湪涓€璧凤紝杩欎釜鍜?multi-model 鏈韩鏄笉鍐茬獊鐨勩€備负浜嗘彁鍗囨€ц兘锛屽悇涓妯℃暟鎹簱澶勭悊鏂规硶骞朵笉涓€鏍凤細閲囩敤涓嶅悓鐨勫瓨鍌ㄥ紩鎿庯紝鎴栬€呮槸鍚屼竴濂楀瓨鍌ㄥ紩鎿庯紝鏁版嵁缁撴瀯鍙兘浼氬仛鎴愪笉鍚岀殑鏍峰瓙銆?/p>

Q锛氬浘鏌ヨ璁捐鐨勫嚭鍙戠偣鏄粈涔堬紵涓轰粈涔堜笉鑰冭檻涓€寮€濮嬪熀浜?Gremlin 寮€鍙戯紵

A锛氬浜庢暟鎹垎鏋愮殑鍚屽锛孏remlin 骞朵笉鏄竴涓綆闂ㄦ璇█锛屾湁浜涗笉鍙嬪ソ銆傚綋鏃?Gremlin 鐨勮璁″疄鐜拌姹傛瘡涓畻瀛愬彂鍑烘潵涔嬪悗蹇呰繘琛屾墽琛屽嚭鏉ョ粨鏋滐紝涓句釜渚嬪瓙锛屾垜鐜板湪瑕佸仛涓€涓?.out 鍜?.in锛屾垜蹇呴』寰楀厛鎵ц .out 鍐嶈繘琛?.in锛岃繖鏍峰氨涓嶈兘杩涜涓€涓叏灞€浼樺寲銆傝€?18 骞寸殑鏃跺€欙紝openCypher 骞朵笉瀹屽杽锛屽皬闂鏈変簺锛岃〃杈惧姏涓嶈闇€瑕?APOC 杩涜琛ュ厖锛岃€?APOC 娉曞緥鍗忚骞朵笉鍍?openCypher 閭d箞纭畾锛屾墍浠ュ熀浜庢锛屾垜浠嚜鐮斾簡 nGQL銆傚湪 19 骞村紑濮嬶紝GQL锛堟煡璇㈣瑷€鏍囧噯鍖栵級杩愬姩寮€濮嬩簡锛孏QL銆丆ypher 鍜?openCypher 鍏崇郴姣旇緝鏄庢樉锛屾墍浠ユ紨鍙樻垚浜嗙幇鍦ㄧ殑 nGQL銆?/p>

鏈枃涓鏈変换浣曢敊璇垨鐤忔紡锛屾杩庡幓 GitHub锛歨ttps://github.com/vesoft-inc/nebula issue 鍖哄悜鎴戜滑鎻?issue 鎴栬€呭墠寰€瀹樻柟璁哄潧锛歨ttps://discuss.nebula-graph.com.cn/ 鐨?寤鸿鍙嶉 鍒嗙被涓嬫彁寤鸿 馃憦锛涗氦娴佸浘鏁版嵁搴撴妧鏈紵鍔犲叆 Nebula 浜ゆ祦缇よ鍏堝~鍐欎笅浣犵殑 Nebula 鍚嶇墖锛孨ebula 灏忓姪鎵嬩細鎷変綘杩涚兢~~


https://www.xamrdz.com/database/6jm1995249.html

相关文章: