NewSQL TiDB vs CockroachDB

 

TiDB和CockroachDB都秉承Google Spanner的衣钵,分层结构和实现的依赖的存储等都有不少共同性。
由于TiDB兼容MySQL的协议,CockroachDB兼容pg协议,在国内TiDB使用的案例比较多,涵盖了TMD,CockroachDB使用
案例比较少,CockroachDB国内的使用用户有百度、京东物流等.
可能的原因:
1.pg在国内互联网领域储备的人才较少
2.pg在国内早期互联网使用的较少,缺少生产上的真实应用场景.

但是目前二者的定位可能也不一样:
TiDB定位于HTAP,github上的关键词为:
distributed-database
distributed-transactions
database
scale
mysql
htap
mysql-protocol


CockroachDB:
open source, 
cloud-native SQL database
go
database
sql
distributed-database
cockroachdb
TiDB部署到生产确实需要消耗较多的高配置机器,至少需要6台;
CockroachDB 至少需要3台。

CockroachDB 强调云中立,cloud database;
TiDB目前对cloud的支持还是有限的。


截止2019年3月15日 二者在github上受欢迎的比对信息:

 https://db-engines.com/en/ranking趋势比对:

具体的比对信息如下:
比对的版本以2.1.5版本为主,当然兼顾了二者Roadmap。

 

 对比项目说明TiDBCockroachDB备注
基本信息start year项目启动年月   
 language编程语言GolangRustGoalang 
Github Watch重度关注者1207700 
Github stars喜欢的人1773715610 
Github forks查看代码的人25441694 
contributors代码贡献者247228 
兼容协议 MySQLPostgresql 
开发对象    
 存储过程Stored ProceduresNoplanning 
自定义函数custom functionNoplanning 
触发器triggerNoplanning 
视图viewYesYes 
序列sequenceNoYes 
游标cursorNoNo 
任务Job or eventNoYes 
索引IndexYesYes 
tableYesYes 
临时表temporary tableNoNo 
      
 Data type(数据类型)    
int YesYes 
FLOAT,REAL YesYes 
BOOLEAN YesYes 
DECIMAL,NUMERIC YesYes 
NULL YesYes 
BYTES NoYes 
STRING YesYes 
AUTO INCREMENT YesYes 
ARRAY NoYes 
UUID YesYes 
TIME YesYes 
SET ENUM YesYes 
INET NoYes 
generation Key生成列YesYes 
UNSIGNED INT YesNo(Not plan) 
      
 Constraints(约束)    
Not null非空约束YesYes 
unique唯一约束YesYes 
Primary key主键YesYes 
check检查约束NoYes 
Foreign Key外键NoYes 
Default Value默认值YesYes 
      
 Transactions(事务)    
Transactions(ACID) YesYes 
BEGIN YesYes 
COMMIT YesYes 
ROLLBACK YesYes 
SAVEPOINT YesYes 
      
 Index(索引)    
indexes普通索引YesYes 
Multi-column indexes多列索引YesYes 
Covering indexes覆盖索引YesYes 
Inverted indexes反转索引NOYes 
Multiple indexes per query每个查询多个索引Yesplanning 
Full-text indexes全文索引NOplanning 
Prefix/Expression Indexes前缀索引/表达式索引NOPotential 
Geospatial indexes地理信息索引NOPotential 
Hash indexes哈希索引NONo 
Partial indexes部分索引NONO 
      
 clauses(语句)    
Common table expressionwith 语句PlanningYes(Partial) 
Windows functions窗口函数PlanningYes 
regular expression正则表达式planningYes 
JSON Yes(Partial)Yes 
XML NONO 
SELECT INTO Yes(Alternative)Yes(Alternative) 
CTAS NOYes 
MERGE YesYes(upset) 
delete YesYes 
insert YesYes 
update YesYes 
truncate YesYes 
LIMIT YesYes 
LIMIT with offset YesYes 
RETURNING NoYes 
      
 partition table(分区表)    
 rangeYesYes(Enterprise Edtion) 
 listNoYes(Enterprise Edtion) 
 HashYesYes(Enterprise Edtion) 
 subpartitionNoYes(Enterprise Edtion) 
 事务隔离级别 SISSI(Serializable 
Snapshot Isolation)
 
 表级别锁 乐观锁乐观锁 
行级别锁 乐观锁乐观锁 
     
     
     
     
管理user用户YesYes 
 role角色NOYes(Enterprise Edtion) 
grant授权YesYes 
revoke撤销YesYes 
statistics统计信息YesYes 
explain执行计划YesYes 
backup Recovery备份恢复YesYes 
Query management stmt查询进程管理Yes(Kill tidb PID) Yes(cancel query) 
Transaction management事务管理YesYes 
Audit审计planningYesEXPERIMENTAL 
部署windows NoYes 
 Linux YesYes 
Mac NoYes 
     
docker  Yescloud-neutral
Kubernetes YesYes
Mesosphere DC/OS  Yes
Rolling update滚动升级YesYes 
     
manual deployment手动部署Yes(不推荐)Yes 
Orchestration容器编排部署Yes(试验性质)Yes 
DockerDockerYesYes 
monitor and alert监控告警YesYesprometheus alertmanager
Production machine最小的生产主机36 
     
架构水平扩展Scale out   
 高可用HA   
异地多活geo-distributed   
数据复制Data replication   
自动负载均衡    
容错与恢复    
数据迁移Data MigrationYes(MySQLCSV)Yes(MySQL,pg,CSV) 
扩展对接kafka TiDB-binlogCDC 
 回撤数据 MySQLNO 
 复制 TiDBNO 
 第三方支持    
 主流编程语言接口(C\C++\Java
\Python\Go\NodeJS)
 YesYes 


https://pingcap.com/docs/ROADMAP/参考:

https://github.com/cockroachdb/cockroach/wiki/Roadmap

https://pingcap.com/docs-cn/v2.1/ROADMAP/#tidb

https://www.cockroachlabs.com/docs/stable/sql-feature-support.html

https://github.com/cockroachdb/cockroach/blob/master/docs/design.md

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值