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:
-
-
- 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.
- 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.
- 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.
- 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).
- 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.
- We can now create a database. To do so, click DATABASES, name your database and click the check icon.
- 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.
- To connect to the instance, use these steps:
- Install the CockroachDB command line client (CLI) using the instructions.
- 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
- 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"
- 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.
-
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!
The post Getting Started with ObjectRocket’s CockroachDB appeared first on ObjectRocket.