cockroach

command module
v0.0.0-...-f27897a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2014 License: Apache-2.0 Imports: 3 Imported by: 0

README

Cockroach Build Status GoDoc

A Scalable, Geo-Replicated, Transactional Datastore

Getting and building

A working Go environment and prerequisites for building RocksDB are both presumed.

go get github.com/cockroachdb/cockroach
cd $GOPATH/src/github.com/cockroachdb/cockroach
./bootstrap.sh
make

Design

Cockroach is a distributed key/value datastore which supports ACID transactional semantics and versioned values as first-class features. The primary design goal is global consistency and survivability, hence the name. Cockroach aims to tolerate disk, machine, rack, and even datacenter failures with minimal latency disruption and no manual intervention. Cockroach nodes are symmetric; a design goal is one binary with minimal configuration and no required auxiliary services.

Cockroach implements a single, monolithic sorted map from key to value where both keys and values are byte strings (not unicode). Cockroach scales linearly (theoretically up to 4 exabytes (4E) of logical data). The map is composed of one or more ranges and each range is backed by data stored in RocksDB (a variant of LevelDB), and is replicated to a total of three or more cockroach servers. Ranges are defined by start and end keys. Ranges are merged and split to maintain total byte size within a globally configurable min/max size interval. Range sizes default to target 64M in order to facilitate quick splits and merges and to distribute load at hotspots within a key range. Range replicas are intended to be located in disparate datacenters for survivability (e.g. { US-East, US-West, Japan }, { Ireland, US-East, US-West}, { Ireland, US-East, US-West, Japan, Australia }).

Single mutations to ranges are mediated via an instance of a distributed consensus algorithm to ensure consistency. We’ve chosen to use the Raft consensus algorithm. All consensus state is stored in RocksDB.

A single logical mutation may affect multiple key/value pairs. Logical mutations have ACID transactional semantics. If all keys affected by a logical mutation fall within the same range, atomicity and consistency are guaranteed by Raft; this is the fast commit path. Otherwise, a non-locking distributed commit protocol is employed between affected ranges.

Cockroach provides snapshot isolation (SI) and serializable snapshot isolation (SSI) semantics, allowing externally consistent, lock-free reads and writes--both from an historical snapshot timestamp and from the current wall clock time. SI provides lock-free reads and writes but still allows write skew. SSI eliminates write skew, but introduces a performance hit in the case of a contentious system. SSI is the default isolation; clients must consciously decide to trade correctness for performance. Cockroach implements a limited form of linearalizability, providing ordering for any observer or chain of observers.

Similar to Spanner directories, Cockroach allows configuration of arbitrary zones of data. This allows replication factor, storage device type, and/or datacenter location to be chosen to optimize performance and/or availability. Unlike Spanner, zones are monolithic and don’t allow movement of fine grained data on the level of entity groups.

A Megastore-like message queue mechanism is also provided to 1) efficiently sideline updates which can tolerate asynchronous execution and 2) provide an integrated message queuing system for asynchronous communication between distributed system components.


For design details visit: https://docs.google.com/document/d/11k2EmhLGSbViBvi6_zFEiKzuXxYF49ZuuDJLe6O8gBU/edit?usp=sharing

SQL - NoSQL - NewSQL Capabilities

SQL - NoSQL - NewSQL Capabilities

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package gossip implements a protocol for sharing information between Cockroach nodes using an ad-hoc, peer-to-peer network.
Package gossip implements a protocol for sharing information between Cockroach nodes using an ad-hoc, peer-to-peer network.
Package kv provides a key-value API to an underlying cockroach datastore.
Package kv provides a key-value API to an underlying cockroach datastore.
Package multiraft implements the Raft distributed consensus algorithm.
Package multiraft implements the Raft distributed consensus algorithm.
Package rpc provides RPC server and clients specific to Cockroach.
Package rpc provides RPC server and clients specific to Cockroach.
Package server implements a basic HTTP server for interacting with a node.
Package server implements a basic HTTP server for interacting with a node.
Package simulation provides tools meant to visualize or test aspects of a Cockroach cluster on a single host.
Package simulation provides tools meant to visualize or test aspects of a Cockroach cluster on a single host.
Package storage implements the Cockroach storage node.
Package storage implements the Cockroach storage node.
Package structured provides a high-level API for application access to an underlying cockroach datastore.
Package structured provides a high-level API for application access to an underlying cockroach datastore.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL