TiDB數(shù)據(jù)庫的HTAP架構(gòu)內(nèi)核介紹_第1頁
TiDB數(shù)據(jù)庫的HTAP架構(gòu)內(nèi)核介紹_第2頁
TiDB數(shù)據(jù)庫的HTAP架構(gòu)內(nèi)核介紹_第3頁
TiDB數(shù)據(jù)庫的HTAP架構(gòu)內(nèi)核介紹_第4頁
TiDB數(shù)據(jù)庫的HTAP架構(gòu)內(nèi)核介紹_第5頁
已閱讀5頁,還剩29頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、技術創(chuàng)新,變革未來TiDB數(shù)據(jù)庫的HTAP架構(gòu)內(nèi)核介紹What is TiDB?分布式關系型數(shù)據(jù)庫,全面兼容MySQL 協(xié)議HTAP (Hybrid Transactional/Analytical Processing)在本地和云上都有強大的Scale 能力是數(shù)據(jù)庫領域世界范圍內(nèi)的頂級開源項目被超過 1500 家知名企業(yè)所使用目錄TiDB 的HTAP 架構(gòu)一些比較關鍵的設計點使用Raft 協(xié)議復制數(shù)據(jù)可更新的列存引擎結(jié)合行存和列存的優(yōu)勢用戶的使用方式性能測試TiDB HTAP 架構(gòu)的上層視角TiDB Upper ViewTiDB 的HTAP 架構(gòu)Raft Groupidnameage0962

2、Jane307658John453589Jim205523Susan52Row Storeid0962765835895523nameJaneJohnJimSusanage30452052Column StoreSELECT avg(age) from tmp;行存 VS 列存使用 Raft 協(xié)議復制數(shù)據(jù)使用 Raft 協(xié)議在 TiKV 節(jié)點之間,以及 TiKV 和 TiFlash 之間復雜數(shù)據(jù)更容易擴展更低延遲架構(gòu)上的簡潔更容易支持事務的 ACID 特性使用 Raft 協(xié)議復制數(shù)據(jù)使用 Raft 協(xié)議復制數(shù)據(jù)Leader or Follower replicas (Synchronous)L

3、earner replica (Asynchronous)Raft LeaderRaft Learner4Together with MVCC, provides strongly consistent readTiDBT0 WriteT2 Ensure Latest Data3T1 ReadRaft Learner - ReadDeltaTree: 一個可更新的列存引擎寫批量寫& 高頻寫Fast讀為 Scan 而優(yōu)化FastDeltaTree Storage EngineWrit eReadDeltaTree 的設計目標數(shù)據(jù)以主鍵范圍分區(qū)成SegmentSegment 的內(nèi)部結(jié)構(gòu)類似于LSM

4、-TreeCompact不同的Layer 使用不同的存儲結(jié)構(gòu)Delta Layer:More frequent write (1000 IOPS)Random readSmall volume (5%)Stable Layer:Less write (95%)DeltaStableDeltaStablePageStorageDTFiles不同的Layer 使用不同的存儲結(jié)構(gòu)DeltaIndex (A Memory B+Tree)Ins or DelDIDSIDDelta LayerStable LayerInternal NodeLeaf NodePlacedDeltaRowsDeltaInd

5、ex:優(yōu)化讀性能Optimize sort merge:PK compareData copy, one by one.Level 0Level 1Level nStableDeltaStableDeltaStableDeltaLSM-Tree.Sement 0-inf, 100)Sement 1100, 200)Sement n 200, +infDelta Treeselect . where x between (150, 160)VS范圍Scan 與LSM Tree 的區(qū)別數(shù)據(jù)以 Range 分區(qū)類似LSM-Tree,但只有兩層寫優(yōu)化: 使用DeltaCache 緩沖讀優(yōu)化:更少的層數(shù)

6、,且使用DeltaIndex 優(yōu)化 mergeDeltaTree 總結(jié)同時擁有行存和列存的獨特優(yōu)勢回顧TiDB 的HTAP 架構(gòu)Raft GroupTiKV Node 1Store 1Region 1Region 2Region 3Region 4TiKV Node 3Store 3Region 2Region 3Region 4Region 1TiKV Node 2Store 2Region 4Region 3Region 2Region 1TiFlash Node 1TiKV ClusterTiDB/ TiSparkSELECT AVG(s.price) FROM prod p, sale

7、s s WHERE p.pid = s.pidAND p.batch_id = B1328;Index Scan(batch_id = B1328)TableScan(price,pid)在一個查詢內(nèi)部,同時利用行存和列存的優(yōu)勢TiFlash ClusterTiFlash Node 2TiFlash Node 1MPP WorkerOptimizerTiFlash Node 2TiFlash Node 3TiDB-ServerMPP WorkerMPP WorkerPlan SegmentParserUser QueryTiKV Node 1TP Query read KV directlyT

8、iFlash is computing / storage combined for now.It forms MPP cluster in AP workload.AP query might read KV if neededIn MPP mode, TiDB- Server becomes the coordinator.MPP 引擎,v5.0 新特性我們的用戶是如何利用TiDB 的HTAP 能力的?MySQLAPP ServerAnalytical DatabaseBI ServiceTiDBAPP ServerBI ServerTiDB TP + AP In One CaseETLTiDB + Flink性能測試TiFlash MPP vs Spark(v5.0)TiDB vs Others右表是一個航空公司實時航 班起降的分析場景測試約 1.8億條記錄https:/ Lab/ontime-airline- performanceTiDB + TiFlash 的測試結(jié)果/p/106688537TiDBSingleStoreTiDB VS SingleStore , CH-benCHmark,隔離性對比A real-world case總結(jié)TiDB 通過使用異構(gòu)存儲,獲得真正的

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論