YugaByte DB is a transactional, high-performance database for building distributed cloud services. It supports Cassandra-compatible and Redis-compatible APIs, with PostgreSQL in Beta.
Clone or download
Permalink
Failed to load latest commit information.
arcanist_util Add Apache license Sep 7, 2017
bin ENG-4051 #507 Fix TestPgTransactions#testTransactionConflicts: read r… Oct 19, 2018
build-support ENG-4037: Add ability to specify transaction start time externally Oct 19, 2018
cloud Change resource defaults for master/tservers (#510) Oct 23, 2018
cmake_modules ENG-3919: Remove AWS SDK third-party dependency and DNS Manager from … Sep 18, 2018
docs Update yb-perf-v1.0.7.md Aug 31, 2018
java ENG-4051 #507 Fix TestPgTransactions#testTransactionConflicts: read r… Oct 19, 2018
python/yb ENG-4044 Fix how we handle PostgreSQL's text datum to unbreak SELECT … Oct 16, 2018
src Rename StringPiece to GStringPiece to un-break the build on Ubuntu 18.04 Oct 20, 2018
thirdparty ENG-4032: Support date string literal before 1400 AD in YCQL. Oct 18, 2018
www Fix Dashboard UI styling issues Nov 15, 2017
.arcconfig Output compiler command line on compilation failure Jul 7, 2016
.arclint Integrating PostgreSQL with YugaByte distributed transactions; adding… Oct 13, 2018
.clang-format use the google style for the precommit hook Sep 30, 2016
.gitignore Java test improvements: log assertion errors immediately, and only pi… Sep 6, 2018
.travis.yml ENG-2611: Fix notification target in Travis CI configuration Jan 31, 2018
.ycm_extra_conf.py A macro-based DSL for C-to-C++ APIs for PostgreSQL integration Jul 14, 2018
CMakeLists.txt ENG-4032: Support date string literal before 1400 AD in YCQL. Oct 18, 2018
Doxyfile Removing some irrelevant files Sep 8, 2017
LICENSE.txt Removing some irrelevant files Sep 8, 2017
NOTICE.txt Detect the edition based on the Jenkins job name, and add NOTICE.txt … Dec 30, 2017
README.md ENG-4032: Support date string literal before 1400 AD in YCQL. Oct 18, 2018
code_style.xml Ensure our code style enables multiline align to be consistent with g… Jan 25, 2017
requirements.txt Stabilize TestPgWrapper: correctly shut down backends on SIGTERM, and… Sep 26, 2018
version.txt Bumping version in yugabyte to 1.1.3.0 Oct 16, 2018
yb_build.sh Integrating PostgreSQL with YugaByte distributed transactions; adding… Oct 13, 2018
yb_release Properly deactivate old virtualenv; use the shared third-party direct… May 16, 2018
yb_release_manifest.json Integrating PostgreSQL with YugaByte distributed transactions; adding… Oct 13, 2018

README.md

YugaByte DB


License Documentation Status Ask in forum Gitter chat Analytics

YugaByte Database is a transactional, high-performance database for planet-scale cloud applications. This repository contains the Community Edition of the YugaByte Database.

Table of Contents

About YugaByte DB

YugaByte DB offers both NoSQL and SQL in a single, unified database. It is meant to be a system-of-record/authoritative database that applications can rely on for correctness and availability. It allows applications to easily scale up and scale down in the cloud, on-premises or across hybrid environments without creating operational complexity or increasing the risk of outages.

Supported APIs

In terms of data model and APIs, YugaByte DB supports the following on top of a common core data platform:

  • Cassandra Query Language (CQL) - with strong consistency, distributed ACID transactions, low latency secondary indexes and a native JSONB data type
  • Redis - as a full database with automatic sharding, clustering, elasticity
  • PostgreSQL (in progress) - with linear scalability, high availability and fault tolerance

Note: You can run your Apache Spark applications on YugaByte DB

YugaByte DB is driver compatible with Apache Cassandra CQL and Redis - you can run existing applications written using existing open-source client drivers.

The distributed transactions feature is supported in the core data platform. The work to expose this as strongly consistent secondary indexes, multi-table/row ACID operations and SQL support is actively in progress. You can follow the progress of these features in our community forum.

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 & rebalancing, linear scalability, fault tolerance, tunable reads etc.
  • Real world apps - how real-world, end-to-end applications can be built using YugaByte DB.
  • Architecture docs - to understand how YugaByte was designed and how it works

Cannot find what you are looking for? Have a question? We love to hear from you - please post your questions or comments to our community forum.

Developing Apps

Here is a tutorial on implementing a simple Hello World application for YugaByte DB's Cassandra-compatible YCQL and Redis-compatible YEDIS APIs 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 to our community forum if you need something.

Building YugaByte 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. We install Linuxbrew in a separate directory, ~/.linuxbrew-yb-build, 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.

git clone https://github.com/Linuxbrew/brew.git ~/.linuxbrew-yb-build
~/.linuxbrew-yb-build/bin/brew install autoconf automake flex gcc libtool maven readline openssl \
libuuid bzip2

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

Prerequisites for Mac OS X

Install Homebrew:

/usr/bin/ruby -e "$(
  curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install the following packages using Homebrew:

brew install autoconf automake bash bison ccache cmake coreutils flex gnu-tar libtool \
             pkg-config pstree wget zlib maven icu4u

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:

<dependency>
  <groupId>com.yugabyte</groupId>
  <artifactId>cassandra-driver-core</artifactId>
  <version>3.2.0-yb-18</version>
</dependency>

Building the code

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

cd ~/code/yugabyte-db
./yb_build.sh 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.

Running the C++ tests

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

./yb_build.sh release --ctest

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

To run specific test:

./yb_build.sh release --cxx-test util_monotime-test

Also you can run specific sub-test:

./yb_build.sh 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
./yb_build.sh --scb

Running the Java tests

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

./yb_build.sh 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 ./yb_build.sh or omit --scb and then it will build debug binaries automatically.

Alternatively, to run specific test:

./yb_build.sh 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:

./yb_build.sh 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/
TEST-org.yb.client.TestYBClient.xml
org.yb.client.TestYBClient-output.txt
org.yb.client.TestYBClient.testAffinitizedLeaders.stderr.txt
org.yb.client.TestYBClient.testAffinitizedLeaders.stdout.txt
…
org.yb.client.TestYBClient.testWaitForLoadBalance.stderr.txt
org.yb.client.TestYBClient.testWaitForLoadBalance.stdout.txt
org.yb.client.TestYBClient.txt

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

Reporting Issues

Please use GitHub issues to report issues. Also feel free to post on the YugaByte Community Forum.

Contributing

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

License

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