一、基本描述
1、TiDB
? ? ? 國產(chǎn)驕傲。從2015年開始,至今已8年,當(dāng)前最新版本是7.5.x。TiDB 開源分布式 NewSQL 關(guān)系型數(shù)據(jù)庫 是新一代開源分布式 NewSQL 數(shù)據(jù)庫,模型受 Google Spanner / F1 論文的啟發(fā),實(shí)現(xiàn)了自動(dòng)的水平伸縮,強(qiáng)一致性的分布式事務(wù),基于 Raft 算法的多副本復(fù)制等重要 NewSQL 特性。
? ? ? TiDB 結(jié)合了 RDBMS 和 NoSQL 的優(yōu)點(diǎn),部署簡單,在線彈性擴(kuò)容和異步表結(jié)構(gòu)變更不影響業(yè)務(wù), 真正的異地多活及自動(dòng)故障恢復(fù)保障數(shù)據(jù)安全,同時(shí)兼容 MySQL 協(xié)議,使遷移使用成本降到極低。
2、CockroachDB (小強(qiáng)DB)
? ? ? 源于美國。當(dāng)前最新版本:v23.1.x。CockroachDB(又名為蟑螂DB,常常稱為小強(qiáng)DB),是構(gòu)建于事務(wù)處理及強(qiáng)一致性KV存儲(chǔ)上的分布式SQL數(shù)據(jù)庫,支持水平擴(kuò)展、自動(dòng)容錯(cuò)處理、強(qiáng)一致性事務(wù),并且提供SQL接口用于數(shù)據(jù)處理,是Google Spanner/F1的開源實(shí)現(xiàn)。文章來源:http://www.zghlxwxcb.cn/news/detail-811569.html
? ? ? ? CockroachDB適用于應(yīng)用對(duì)數(shù)據(jù)要求精確、可靠、完全正確的場景,支持自動(dòng)復(fù)制、均勻分布、基于極小配置的數(shù)據(jù)恢復(fù),可用于分布式的、可復(fù)制的聯(lián)機(jī)事務(wù)處理(OLTP),多數(shù)據(jù)中心的部署,私有云的基礎(chǔ)構(gòu)建,它不適用于讀少寫多的場景,可以用內(nèi)存數(shù)據(jù)庫來代替,也不適用于復(fù)雜的join查詢,重量級(jí)的數(shù)據(jù)分析及聯(lián)機(jī)分析處理(OLAP)。雖然兼容 Postgre?協(xié)議,但該數(shù)據(jù)庫也有一個(gè)為分布式數(shù)據(jù)庫設(shè)計(jì)的自定義SQL實(shí)現(xiàn)。文章來源地址http://www.zghlxwxcb.cn/news/detail-811569.html
二、對(duì)比
主要特性 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
名稱 | CockroachDB? | TiDB? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
數(shù)據(jù)庫類型 | 關(guān)系性數(shù)據(jù)庫 | 關(guān)系性數(shù)據(jù)庫 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
輔助數(shù)據(jù)庫模型 | - | 文檔存儲(chǔ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
官方說明文檔 | www.cockroachlabs.com/-docs | docs.pingcap.com/-tidb/-stable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
商業(yè)公司 | Cockroach Labs | PingCAP, Inc. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
初始版本 | 2015 | 2016 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
當(dāng)前穩(wěn)定版本 | 23.1.1, May 2023 | 7.5.0, December 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
License? | Open Source? | Open Source? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
僅基于云? | no | no | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DBaaS產(chǎn)品(贊助鏈接) | CockroachDB: A cloud-native, distributed SQL database designed for speed, scale, and survival. Get started for free today with a?fully-managed CockroachDB cluster?-- leave operations behind and get your app to market faster. | TiDB Cloud: Fully-managed TiDB Service. Bring everything great about TiDB to the cloud. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
基于編程語言 | Go | Go, Rust | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
支持的操作系統(tǒng) | Linux macOS Windows |
Linux | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Data scheme | dynamic schema | yes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
XML support? | no | no | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
二級(jí)索引 | yes | yes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SQL? | yes, wire compatible with PostgreSQL | yes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
APIs and other access methods | JDBC | GORM JDBC ODBC Proprietary protocol SQLAlchemy |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
支持的編程語言接口 | C# C++ Clojure Go Java JavaScript (Node.js) PHP Python Ruby Rust |
Ada C C# C++ D Delphi Eiffel Erlang Haskell Java JavaScript (Node.js) Objective-C OCaml Perl PHP Python Ruby Scheme Tcl |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Server-side scripts? | no | no | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
觸發(fā)器 | no | no | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Partitioning methods? | horizontal partitioning (by key range)? | horizontal partitioning (by key range) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Replication methods? | Multi-source replication using RAFT | Using Raft consensus algorithm to ensure data replication with strong consistency among multiple replicas. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MapReduce? | no | yes? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Consistency concepts? | Immediate Consistency | Immediate Consistency | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Foreign keys? | yes | yes? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Transaction concepts? | ACID | ACID | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Concurrency? | yes | yes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Durability | yes | yes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In-memory capabilities? | no | no | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
User concepts? | Role-based access control | Fine grained access rights according to SQL-standard |
到了這里,關(guān)于【NewSQL】-- 分布式數(shù)據(jù)庫 TiDB 和 CockroachDB的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!