You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: frequently-asked-questions.md
+21-8Lines changed: 21 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,22 +15,20 @@ CockroachDB is inspired by Google's [Spanner](http://research.google.com/archive
15
15
16
16
## When is CockroachDB a good choice?
17
17
18
-
CockroachDB is especially well suited for applications that require:
18
+
CockroachDB is well suited for applications that require reliable, available, and correct data regardless of scale. It is built to automatically replicate, rebalance, and recover with minimal configuration and operational overhead. Specific use cases include:
19
19
20
-
- Horizontal scalability
21
-
- Business continuity (survivability)
22
-
- High levels of consistency
23
-
- Support for distributed ACID transactions
20
+
- Distributed or replicated OLTP
21
+
- Multi-datacenter deployments
22
+
- Cloud-native infrastructure initiatives
24
23
25
24
## When is CockroachDB not a good choice?
26
25
27
26
CockroachDB is not a good choice when very low latency reads and writes are critical; use an in-memory database instead.
28
27
29
28
Also, CockroachDB is not yet suitable for:
30
29
31
-
- Use cases requiring SQL joins ([the feature still needs optimization](https://www.cockroachlabs.com/blog/cockroachdbs-first-join/))
32
-
- Use cases requiring JSON/Protobuf data ([slated for an upcoming release](https://github.com/cockroachdb/cockroach/issues/2969))
33
-
- Real-time analytics (on our long-term roadmap)
30
+
- Complex SQL JOINS ([the feature still needs optimization](https://www.cockroachlabs.com/blog/cockroachdbs-first-join/))
31
+
- Heavy analytics / OLAP
34
32
35
33
## How easy is it to install CockroachDB?
36
34
@@ -70,6 +68,21 @@ CockroachDB guarantees the SQL isolation level "serializable", the highest defin
70
68
It does so by combining the Raft consensus algorithm for writes and a custom time-based synchronization algorithms for reads.
71
69
See our description of [strong consistency](strong-consistency.html) for more details.
72
70
71
+
## How is CockroachDB both highly availability and strongly consistent?
72
+
73
+
The [CAP theorem](https://en.wikipedia.org/wiki/CAP_theorem) states that it is impossible for a distributed system to simultaneously provide more than two out of the following three guarantees:
74
+
75
+
- Consistency
76
+
- Availability
77
+
- Partition Tolerance
78
+
79
+
CockroachDB is a CP (consistent and partition tolerant) system. This means
80
+
that, in the presence of partitions, the system will become unavailable rather than do anything which might cause inconsistent results. For example, writes require acknowledgements from a majority of replicas, and reads require a lease, which can only be transferred to a different node when writes are possible.
81
+
82
+
Separately, CockroachDB is also Highly Available, although "available" here means something different than the way it is used in the CAP theorem. In the CAP theorem, availability is a binary property, but for High Availability, we talk about availability as a spectrum (using terms like "five nines" for a system that is available 99.999% of the time).
83
+
84
+
Being both CP and HA means that whenever a majority of replicas can talk to each other, they should be able to make progress. For example, if you deploy CockroachDB to three datacenters and the network link to one of them fails, the other two datacenters should be able to operate normally with only a few seconds' disruption. We do this by attempting to detect partitions and failures quickly and efficiently, transferring leadership to nodes that are able to communicate with the majority, and routing internal traffic away from nodes that are partitioned away.
85
+
73
86
## Why is CockroachDB SQL?
74
87
75
88
At the lowest level, CockroachDB is a distributed, strongly-consistent, transactional key-value store, but the external API is Standard SQL with extensions. This provides developers familiar relational concepts such as schemas, tables, columns, and indexes and the ability to structure, manipulate, and query data using well-established and time-proven tools and processes. Also, since CockroachDB supports the PostgreSQL wire protocol, it’s simple to get your application talking to Cockroach; just find your [PostgreSQL language-specific driver](install-client-drivers.html) and start building.
0 commit comments