Computer >> Computer tutorials >  >> Programming >> Database

Get started with ObjectRocket CockroachDB

Originally published on Jan 13, 2020, at ObjectRocket.com/blog

Traditionally, NoSQL databases scale better than SQL databases because of their non-relational nature. CockroachDB® bridges the gap between NoSQL and SQL databases by providing scalability.

Get started with ObjectRocket CockroachDB

The system architecture of NoSQL databases, which are document key/value stores, makes it easier to scale horizontally by adding more servers. On the other hand, SQL databases have important features like atomicity, consistency, isolation and durability (ACID) compliance, advanced transactional capabilities, and 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 most features of NoSQL databases while still maintaining ACID compliance and providing support for complex transactions. CockroachDB is highly-resilient, distributed, and provides SQL at scale.

Try it out now

You can create new instances at no charge and try this NewSQL database out for yourself. Follow these steps to get started with CockroachDB on the ObjectRocket platform:

  1. Log in to Mission Control. If you don’t have an ObjectRocket account, you can sign up by clicking Sign Up.

    Get started with ObjectRocket CockroachDB
  2. Click Create Instance. Give the instance a name and choose CockroachDB as the type of service. You can then select the version and the region.

    Get started with ObjectRocket CockroachDB
  3. Next, use the and + buttons to modify the capacity (storage/memory), if needed. You can also choose between Basic or Standard for the instance size.

    Get started with ObjectRocket CockroachDB
  4. 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 computer or server IP address from which you want to connect. Select the role to grant to the IP address (either access to the CockroachDB instance using CLI or to the CockroachDB Admin UI). 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).

    Get started with ObjectRocket CockroachDB
  5. Click CREATE INSTANCE at the bottom of the page. The instance will be ready to use within a couple of minutes. The instances page on Mission Control shows the newly created CockroachDB instance. Click the arrow button in the upper right to expand the view and then click VIEW MORE DETAILS.

    Get started with ObjectRocket CockroachDB
  6. Create a database by clicking DATABASES, name your database, and click the checkmark icon.

    Get started with ObjectRocket CockroachDB
  7. Click USERS to add a new user. Enter a username and password, choose the role (currently only admin), and click the checkmark icon.

Get started with ObjectRocket CockroachDB
  1. Connect to the instance by using these steps:

    a. Install the CockroachDB command-line client (CLI) following the instructions. b. In your ObjectRocket UI Mission Control, click the Connect tab and copy the connection string provided, simlar to the following example: postgres://DBUSER:[email protected]:2166/DBNAME?sslmode=require c. In your terminal, use the CockroachDB command line client to run the command: cockroach sql --url "postgres://DBUSER:[email protected]:2166/demo?sslmode=require"

If you’re connecting through 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 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). You can connect by using the same username and password you created earlier.

Get started with ObjectRocket CockroachDB Get started with ObjectRocket CockroachDB

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

Benefits of deploying CockroachDB on ObjectRocket

  • Scale CockroachDB on-demand: Add more nodes by using our API.
  • Security: We protect CockroachDB instances through RBAC, access control lists (ACL), and TLS encryption at rest/transit/in use. Also, all users must authenticate to connect.
  • Backups: We provide daily backups for each instance (14-day backup retention)and Point-in-Time recovery.
  • Access to our world-class support and 24/7 monitoring: We support all of your instances.
  • Multiple Cloud providers: 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 understand the awesome benefits of deploying a cluster with us, go forth and build one. Check it out and let us know what you think. If you have any questions getting started, email us at [email protected].

Use the Feedback tab to make any comments or ask questions. You can also click Sales Chat to chat now and start the conversation.

Click here to view The Rackspace Cloud Terms of Service.