CockroachDB

Getting Started with ObjectRocket’s CockroachDB

By January 13, 2020 No Comments

Traditionally, NoSQL databases have been known to scale better than SQL databases due to their non-relational nature. The system architecture of NoSQL databases, which are document or key/value stores, makes it easier to scale horizontally by adding more servers. SQL databases, on the other hand, have important features like ACID compliance, advanced transactional capabilities, and also strong data integrity by enforcing schemas for database tables. 

CockroachDB, a distributed SQL (or NewSQL) database, bridges the gap between NoSQL databases and SQL databases by providing the scalability and most features of NoSQL databases, while still maintaining ACID compliance and also providing support for complex transactions. CockroachDB is highly-resilient, distributed, and provides SQL at scale. 

Try it out now!

You can spin up new instances at no charge and try this NewSQL database out for yourself. To get started with CockroachDB on the ObjectRocket platform, just follow these steps:

      1. Log in to Mission Control https://app.objectrocket.cloud/. If you do not already have an ObjectRocket account, you can sign up by clicking on the Sign Up link.

      2. Click on Create Instance. Give the instance a name, and choose CockroachDB as the type of service. You can then select the version and the region, and click GO TO STEP 2.
      3. On the next step, you can use the and + buttons to increase the capacity (storage/memory). You can also choose between Basic or Standard for the instance size, and then click GO TO STEP 3.
      4. Next you will need to define which IP addresses are allowed to connect to the instance. You can allow all IP addresses to connect by choosing the ALLOW ANY IP option, or allow your own computer’s IP address to connect by selecting the USE MY IP button. Alternatively, you can type in the IP of the computer/server that you wish to connect from. Select the role that you wish to grant to the IP (access to the CockroachDB instance using CLI or to the CockroachDB Admin UI), and then click ADD. Note that the CockroachDB Admin UI role grants access to the admin UI only, while the CockroachDB role grants access to both (CLI and Admin UI).
      5. Now that we’ve added an ACL (access control list) and the role for the IP address, we can proceed to click on CREATE INSTANCE at the bottom of the page. The instance will be created and ready to use within a couple of minutes.The instances page (https://app.objectrocket.cloud/mission-ctrl/instances) on Mission Control will show the newly created CockroachDB instance. You can click on the arrow button in the upper right to expand the view, and then click VIEW MORE DETAILS.

      6. We can now create a database. To do so, click DATABASES, name your database and click the check icon. 
      7. To add a new user, click USERS, type the username, define a password, choose the role (currently only admin), then click on the check icon.
      8. To connect to the instance, use these steps:
        1. Install the CockroachDB command line client (CLI) using the instructions.
        2. In your ObjectRocket UI (Mission Control) click on the Connect tab and copy the connection string provided. It will be in the form:
          postgres://DBUSER:DBPASS@ingress.w89sujpz.launchpad.objectrocket.cloud:2166/DBNAME?sslmode=require
        3. In your terminal use the CockroachDB command line client to run the command:
          cockroach sql --url
          "postgres://DBUSER:DBPASS@ingress.w89sujpz.launchpad.objectrocket.cloud:2166/demo?sslmode=require"

If you’re connecting via a programming language such as Python, PHP, Java, Ruby or Node.js, you can find information on client drivers at https://www.cockroachlabs.com/docs/stable/install-client-drivers.html

On the Connect tab, you can also find the URL for the CockroachDB admin UI. To access the admin UI, ensure the IP that you’re connecting from is whitelisted (using the Whitelist IPs button), and you can then connect using the same username and password created earlier.


Within the UI, you can view the cluster health, view node, replica status, SQL performance and a whole lot more. 

Benefits of deploying CockroachDB on ObjectRocket!

  • Scale CockroachDB on-demand by adding more nodes. This can be done via our API.
  • Security. Our CockroachDB instances are protected by RBAC, ACLs, TLS encryption at rest/transit/in use, and all users have to authenticate in order to connect. 
  • Backups. We provide daily backups for each instance (backups are retained for 14 days) and Point-in-Time recovery. 
  • Access to our world-class support and 24/7 monitoring of your instance. 
  • Our fully-managed CockroachDB service supports applications hosted on AWS and GCP.

Now that you know how to get started using CockroachDB on ObjectRocket and the awesome benefits for deploying a cluster with us, go forth and build one. Check it out and let us know what you think, and if you have any questions getting started, email us at support@objectrocket.com!

Sam Hagin

Sam Hagin

Sam Hagin is a Customer Data Engineer (CDE) with ObjectRocket, a Rackspace company. Sam delights in delighting our customers, whether that is by analyzing and managing data sets, architecting and testing database designs, or even writing code that solves a specific issue. Sam's strengths are a deep knowledge of SQL database design and multiple programming languages, plus a strong desire to provide a truly Fanatical Experience for our customers.