




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、TiDB架構(gòu)設(shè)計(jì)指南TiDB Design And ArchitectureWhy we need a new databaseThe goal of TiDBDesign & ArchitectureStorage LayerSchedulerSQL LayerSpark integrationTiDB on Kubernetes From scratch Whats wrong with the existing DBs?RDBMSNoSQL & Middleware NewSQL:F1 & Spanner1970s20102015PresentMySQLPostgreSQL Oracle
2、DB2.Redis HBase Cassandra MongoDB.Google Spanner Google F1 TiDBRDBMSNoSQLNewSQLScalabilityHigh AvailabilityACID TransactionSQLA Distributed, Consistent, Scalable, SQL Database that supports the best features of both traditional RDBMS and NoSQLOpen source, of courseData storageData distributionData r
3、eplicationAuto balanceACID TransactionSQL at scaleApplicationsMySQL Drivers(e.g. JDBC)TiDBTiKVMySQL ProtocolRPCSQL LayerStorageLayerGood start! RocksDB is fast and stable.Atomic batch writeSnapshotHowever Its a locally embedded KV store.Cant tolerate machine failuresScalability depends on the capaci
4、ty of the disk Fault ToleranceUse Raft to replicate dataKey features of RaftStrong leader: leader does most of the work, issue all log updatesLeader electionMembership changesImplementation:Ported from etcdReplicas are distributed across machines/racks/data-centers Fault ToleranceMachine 1Machine 2M
5、achine 3RocksDBRocksDBRocksDBRaftRaft ScalabilityWhat if we SPLIT data into many regions?We got many Raft groups.Region = Contiguous KeysHash partitioning or Range partitioning?Redis: Hash partitioningHBase: Range partitioningRange Scan:Select * from t where c 10 and c a - dRegion 2 - e - hRegion n
6、- w - zData is stored/replicated/scheduled in regions(-, +) Sorted MapLogical KeySpace Meta: Start_key, end_key)Thats simpleLogical splitJust Split & MoveSplit safely using RaftRegion 1Region 1Region 2Region1Region3Region 1Region 2Region 1*Region 2Region 2Region 3Region 3Node ANode BNode CNode DRegi
7、on1Region3Region1Region 2Region 1*Region 2Region 2Region 3Region 3Node BNode ANew NodeENode CNode DRegion1Region3Region1*Region 2Region 2Region 2Region 3Region1Region 3Node ANode BNode CNode DNew NodeERegion 1Region1Region3Region1*Region 2Region 2Region 2Region 3Region1Region 3Node ANode BNode CNode
8、 DNew NodeEClientStore 1Region 1Region 3Region 5Region 4Store 3Region 3Region 5Region 2Store 2Region 1Region 3Region 2Region 4Store 4Region 1Region 5Region 2Region 4RPCRPCRPCRPCTiKV node 1TiKV node 2TiKV node 3TiKV node 4Placement DriverPD 1PD 2PD 3Raft GroupMVCCData layoutkey1_version2 - valuekey1_
9、version1 - valuekey2_version3 - valueLock-free snapshot readsTransactionInspired by Google PercolatorAlmost decentralized 2-phasecommitHighly layeredRaft for consistency and scalabilityNo distributed file systemFor better performance and lower latencyTransactionMVCCRaftKVLocal KV Storage (RocksDB)Pr
10、ovide the Gods view of the entire clusterStore the metadataClients have cache of placement information.Maintain the replication constraint3 replicas, by defaultData movement for balancing the workloadIts a cluster too, of course.Thanks to Raft.Placemen tDriver Placement DriverPlacement DriverRaftRaf
11、tRaftNode 1Region ARegion BNode 2PDScheduling StrategyCluster InfoAdminHeartBeat with InfoSchedulin g CommandRegion CConfi gMovementReplica number in a raft groupReplica geo distributionRead/Write workloadLeaders and followersTables and TiKV instancesOther customized scheduling strategySQL is simple
12、 and very productiveWe want to write code like this:SELECT COUNT(*) FROM userWHERE age 20 and age 10Can we push down filters?select count(*) from personwhere age 20 and age 20 and age 20 and age 20 and age 30TiDB knows that Region 1 / 2 / 5stores the data of person table.We just build a protocol lay
13、er that is compatible with MySQL. Then wehave all the MySQL drivers.All the toolsAll the ORMsAll the applicationsThats what TiDB does.KV APICoprocessorTxn, TransactionMVCCRawKV, Raft KVRocksDBPlacement DriverMySQL clientsLoad Balancer (Optional)MySQL ProtocolTiDB SQL LayerKV APIDistSQL APITiDB Serve
14、r (Stateless)MySQL ProtocolTiDB SQL LayerKV APIDistSQL APITiDB Server (Stateless)Pluggable Storage Engine (e.g. TiKV)TiSpark = Spark SQL on TiKVSparkSQL directly on top of a distributed Database StorageHybrid Transactional/Analytical Processing(HTAP) rocksProvide strong OLAP capacity together with T
15、iDBSpark ecosystemTiDBTiDBWorkerSpark DriverMeta dataTiKVTiKVTiKVApplicationSyncerData locationJobTiSparkDistSQL APITiKVTiDBTSO/Data locationWorkerWorkerSpark ClusterTiDB.TiDB Cluster.TiKV Cluster (Storage).DistSQL APIPDPDPDPD ClusterTiKVTiKVTiDBTiKV Connector is better than JDBC connectorIndex supp
16、ortComplex Calculation PushdownCBOPick up the right Access PathJoin ReorderPriority & Isolation LevelAPI ServerSchedulerKubernetes CoreController ManagerTiDB OperatorDeploymentTiDB Cluster ControllerPD ControllerTiKV ControllerTiDB ControllerGC ControllerVolume ManagerDaemonSetTiDB Scheduler: Kube Scheduler + Scheduler Extender DaemonSetUsersUsersAdminTiDB Cloud Manager RESTFul Interface Extern
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025中國(guó)鐵路通信信號(hào)股份有限公司招聘23人筆試參考題庫(kù)附帶答案詳解
- 2025年上半年安徽省蕪湖市煙草專賣局(公司)招聘8人易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025年上半年安徽省渦陽(yáng)縣政府購(gòu)買治安輔助人員641人易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025年上半年安徽滁州市教育體育局所屬事業(yè)單位招聘工作人員4人易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025年上半年安徽淮南經(jīng)濟(jì)技術(shù)開(kāi)發(fā)區(qū)實(shí)業(yè)發(fā)展總公司公開(kāi)招聘巡防隊(duì)員30人易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025年上半年安徽安慶懷寧縣引進(jìn)緊缺專業(yè)人才20人易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2024年民爆器材項(xiàng)目資金需求報(bào)告代可行性研究報(bào)告
- 2025年上半年寧波市國(guó)際交流服務(wù)中心招考易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025年上半年寧波光耀熱電限公司招聘1人易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 【2025】年山東頤養(yǎng)健康產(chǎn)業(yè)發(fā)展集團(tuán)有限公司集團(tuán)總部紀(jì)委筆試考點(diǎn)考試試題及答案
- 醫(yī)院實(shí)習(xí)生崗前培訓(xùn)課件
- 照明燈具統(tǒng)計(jì)表
- 杭州市居住房屋出租安全管理若干規(guī)定
- 2022年江西工業(yè)貿(mào)易職業(yè)技術(shù)學(xué)院職業(yè)適應(yīng)性測(cè)試題庫(kù)及答案解析
- 給水排水管道工程質(zhì)量通病以及防治
- 計(jì)算機(jī)視覺(jué)全套課件
- 中國(guó)聯(lián)通IMS接口規(guī)范 第三分冊(cè):Sh接口 V1.0
- protel完全教程(原理圖部分)
- 迎澤公園文化廣場(chǎng)歌詞匯集
- 環(huán)境化學(xué)物的毒性作用及其影響因素
- Q∕GDW 12176-2021 反竊電監(jiān)測(cè)終端技術(shù)規(guī)范
評(píng)論
0/150
提交評(píng)論