Skip to content
YugaByte DB is the open source, high-performance SQL database for building internet-scale, globally-distributed apps.
Branch: master
Clone or download
nocaway Fixed test log for yb_insert_conflict
The test log needs to be updated because error message for index violation was changed.

Test Plan: Ran yb_insert_conflict test

Reviewers: mihnea, robert

Reviewed By: robert

Subscribers: yql

Differential Revision:
Latest commit 31b85cc Apr 24, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Add a CircleCI config.yml compiling the code on Ubuntu 18.04 (#1242) Apr 23, 2019
arcanist_util Add Apache license Sep 7, 2017
bin ENG-4848: Unify yb-master and yb-tserver under one manager proces Apr 24, 2019
build-support Disable running affected tests only on macOS until #1096 is fixed Apr 24, 2019
cloud Updated helm chart to support multi-az (#1188) Apr 15, 2019
docs Update Mar 17, 2019
java [YSQL] #1109 ON CONFLICT Support Apr 23, 2019
submodules Update yugabyte-installation to commit 6e9be13b5b6029c5e1f4e3d0c51a85… Apr 7, 2019
thirdparty Fix Cassandra C++ driver build on macOS Apr 11, 2019
.arclint Use the yb-ctl script from the yugabyte-installation repository Apr 6, 2019
.clang-format use the google style for the precommit hook Sep 30, 2016
.gitmodules A macro-based DSL for C-to-C++ APIs for PostgreSQL integration Jul 14, 2018
CMakeLists.txt ENG-5061: ASAN:undefined-behavior issue in QLTestSelectedExpr_TestCas… Apr 24, 2019
Doxyfile Removing some irrelevant files Sep 8, 2017
LICENSE.txt Removing some irrelevant files Sep 8, 2017
NOTICE.txt Update build steps for Ubuntu 18.04 in Apr 8, 2019
code_style.xml Ensure our code style enables multiline align to be consistent with g… Jan 25, 2017
python_requirements.txt [#939] [#940] [#941] [#942] Cleanup of stray processes, NFS issues wo… Mar 7, 2019
python_requirements_frozen.txt [#939] [#940] [#941] [#942] Cleanup of stray processes, NFS issues wo… Mar 7, 2019
version.txt Bumping version in yugabyte to Apr 18, 2019 Use the yb-ctl script from the yugabyte-installation repository Apr 6, 2019
yb_release Properly deactivate old virtualenv; use the shared third-party direct… May 16, 2018
yb_release_manifest.json Use the yb-ctl script from the yugabyte-installation repository Apr 6, 2019

YugaByte DB

License Documentation Status Ask in forum Slack chat Analytics

YugaByte Database is the high-performance SQL database for building internet-scale, globally-distributed applications. This repository contains the Community Edition of the YugaByte Database.

Table of Contents

About YugaByte DB

Built using a unique combination of high-performance document store, auto sharding, per-shard distributed consensus replication and multi-shard ACID transactions (inspired by Google Spanner), YugaByte DB serves both scale-out RDBMS and internet-scale OLTP workloads with low query latency, extreme resilience against failures and global data distribution. As a cloud native database, it can be deployed across public and private clouds as well as in Kubernetes environments with ease.


YugaByte DB architecture has 2 layers. At the core is DocDB, YugaByte DB's distributed document store. DocDB is the common database engine for the YugaByte Query Layer (YQL). Applications interact with YQL using the APIs listed below.

YugaByte DB APIs

YugaByte DB supports two flavors of distributed SQL APIs.

  • YugaByte Structured Query Language (YSQL) - A PostgreSQL-compatible fully relational SQL API (currently in beta) with horizontal write scalability and extreme fault tolerance against infrastructure failures. This API is best fit for RDBMS workloads that need scale-out, auto failover and global data distribution while also using relational data modeling features such as JOINs, referential integrity, and multi-shard transactions.

  • YugaByte Cloud Query Language (YCQL) - A SQL-based flexible-schema API with strong consistency, multi-shard transactions, globally-consistent secondary indexes and a native JSONB column type. This API has its roots in the Cassandra Query Language and is best fit for internet-scale OLTP apps that need a semi-relational SQL highly optimized for write-intensive applications as well as blazing-fast query needs.

DocDB, YugaByte DB's Distributed Document Store

DocDB builds on top of the popular RocksDB project by transforming RocksDB from a key-value store (with only primitive data types) to a document store (with complex data types). Every key is stored as a separate document in DocDB, irrespective of the API responsible for managing the key. DocDB’s sharding, replication/fault-tolerance and distributed ACID transactions architecture are all based on the the Google Spanner design first published in 2012.

Getting Started

Here are a few resources for getting started with YugaByte DB:

  • Quick start guide - install, create a local cluster and read/write from YugaByte DB.
  • Explore core features - automatic sharding & re-balancing, linear scalability, fault tolerance, tunable reads and more.
  • Ecosystem integrations - integrations with Apache Kafka/KSQL, Apache Spark, JanusGraph, KairosDB, Presto and more.
  • Real world apps - sample real-world, end-to-end applications built using YugaByte DB.
  • Architecture docs - to understand how YugaByte DB is designed and how it works

Cannot find what you are looking for? Have a question? We love to hear from you - please file a GitHub issue.

Developing Apps

Here is a tutorial on implementing a simple Hello World application on YugaByte DB in different languages:

We are constantly adding documentation on how to build apps using the client drivers in various languages, as well as the ecosystem integrations we support. Please see our app-development docs for the latest information.

Once again, please post your questions or comments as a GitHub issue if you need something.

Building YugaByte DB code

Prerequisites for CentOS 7

CentOS 7 is the main recommended development and production platform for YugaByte.

Update packages on your system, install development tools and additional packages:

sudo yum update
sudo yum groupinstall -y 'Development Tools'
sudo yum install -y ruby perl-Digest epel-release ccache git python2-pip
sudo yum install -y cmake3 ctest3

Also we expect cmake / ctest binaries to be at least version 3. On CentOS one way to achive this is to symlink them into /usr/local/bin.

sudo ln -s /usr/bin/cmake3 /usr/local/bin/cmake
sudo ln -s /usr/bin/ctest3 /usr/local/bin/ctest

You could also symlink them into another directory that is on your PATH.

We also use Linuxbrew to provide some of the third-party dependencies on CentOS. During the build we install Linuxbrew in a separate directory, ~/.linuxbrew-yb-build/linuxbrew-<version>, so that it does not conflict with any other Linuxbrew installation on your workstation, and does not contain any unnecessary packages that would interfere with the build.

We don't need to add ~/.linuxbrew-yb-build/linuxbrew-<version>/bin to PATH. The build scripts will automatically discover this Linuxbrew installation.

Prerequisites for Ubuntu 18.04

In addition to (corresponding) steps required for CentOS 7, the following steps are required for additional packages that need to be installed:

sudo apt-get update
sudo apt-get install uuid-dev libbz2-dev libreadline-dev maven

Prerequisites for Mac OS X

Install Homebrew:

/usr/bin/ruby -e "$(
  curl -fsSL"

Install the following packages using Homebrew:

brew install autoconf automake bash bison ccache cmake coreutils flex gnu-tar icu4c libtool maven \
             ninja pkg-config pstree wget zlib python@2

Also YugaByte DB build scripts rely on Bash 4. Make sure that which bash outputs /usr/local/bin/bash before proceeding. You may need to put /usr/local/bin as the first directory on PATH in your ~/.bashrc to achieve that.

Prerequisites for drivers and sample apps

YugaByte DB core is written in C++, but the repository contains Java code needed to run sample applications. To build the Java part, you need:

Also make sure Maven's bin directory is added to your PATH, e.g. by adding to your ~/.bashrc

export PATH=$HOME/tools/apache-maven-3.5.0/bin:$PATH

if you've installed Maven into ~/tools/apache-maven-3.5.0.

For building YugaByte DB Java code, you'll need to install Java and Apache Maven.

Java driver

YugaByte DB and Apache Cassandra use different approaches to split data between nodes. In order to route client requests to the right server without extra hops, we provide a custom load balancing policy in our modified version of Datastax's Apache Cassandra Java driver.

The latest version of our driver is available on Maven Central. You can build your application using our driver by adding the following Maven dependency to your application:


Building the code

Assuming this repository is checked out in ~/code/yugabyte-db, do the following:

cd ~/code/yugabyte-db
./ release --with-assembly

The above command will build the release configuration, put the C++ binaries in build/release-gcc-dynamic-community, and will also create the build/latest symlink to that directory. Then it will build the Java code as well. The --with-assembly flag tells the build script to build the yb-sample-apps.jar file containing sample Java apps.

For Linux it will first make sure our custom Linuxbrew distribution is installed into ~/.linuxbrew-yb-build/linuxbrew-<version>.

Running the C++ tests

To run all the C++ tests you can use following command:

./ release --ctest

If you omit release argument, it will run java tests against debug YugaByte build.

To run specific test:

./ release --cxx-test util_monotime-test

Also you can run specific sub-test:

./ release --cxx-test util_monotime-test --gtest_filter TestMonoTime.TestCondition

Building Java code alone

You can skip building C++ code, this can be useful when you only need to rebuild Java code:

cd ~/code/yugabyte-db
./ --scb

Running the Java tests

Given that you've already built C++ and Java code you can run Java tests using following command:

./ release --scb --sj --java-tests

If you omit release argument, it will run java tests against debug YugaByte build, so you should then either build debug binaries with ./ or omit --scb and then it will build debug binaries automatically.

Alternatively, to run specific test:

./ release --scb --sj --java-test org.yb.client.TestYBClient

To run a specific Java sub-test within a test file use the # syntax, for example:

./ release --scb --sj --java-test org.yb.client.TestYBClient#testClientCreateDestroy

Viewing log outputs of Java tests

You can find Java tests output in corresponding directory (you might need to change yb-client to respective Java tests module):

$ ls -1 java/yb-client/target/surefire-reports/

Note that the YB logs are contained in the output file now.

Reporting Issues

Please use GitHub issues to report issues.

To live chat with our engineers, use our Slack channel.


We accept contributions as GitHub pull requests. Our code style is available here (mostly based on Google C++ Style Guide).


YugaByte DB Community Edition is distributed under an Apache 2.0 license. See the LICENSE.txt file for details.

You can’t perform that action at this time.