CockroachDB is a distributed database architected for modern cloud applications. It is wire compatible with PostgreSQL and backed by a Key-Value Store, which is either RocksDB or a purpose-built derivative, called Pebble.
TiDB is an open source distributed Hybrid Transactional/Analytical Processing (HTAP) database that supports MySQL and Spark SQL syntaxes.
Primary database model
Relational DBMS
Relational DBMS
Website
www.cockroachlabs.com
pingcap.com
Technical documentation
www.cockroachlabs.com/docs
docs.pingcap.com/tidb/stable
Developer
Cockroach Labs
PingCAP, Inc.
Initial release
2015
2016
Current release
20.2, November 2020
4.0.10 , January 2021
License
Open Source
Open Source
Cloud-based only
no
no
Implementation language
Go
Go, Rust
Server operating systems
Linux macOS Windows
Linux
Data scheme
dynamic schema
yes
Typing
yes
yes
XML support
no
no
Secondary indexes
yes
yes
SQL
yes, wire compatible with PostgreSQL
yes
APIs and other access methods
JDBC
JDBC ODBC Proprietary protocol
Supported programming languages
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
Triggers
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
no
Transaction concepts
ACID
ACID
Concurrency
yes
yes
Durability
yes
yes
In-memory capabilities
no
no
User concepts
Role-based access control
Users with fine-grained authorization concept. No user groups or roles.