DEV Community

Cover image for Qualify Your Database Needs with DataStax Astra Stargate REST API
Doug Wettlaufer for DataStax

Posted on • Originally published at Medium

Qualify Your Database Needs with DataStax Astra Stargate REST API

Image description

This is the first post in a series we introduced here on using Stargate application programming interfaces (APIs) to quickly qualify your database needs right in your browser. We’ll begin with the most common API — the representational state transfer (REST) API. To help you learn how to use it, we’ve created a Katacoda scenario that will show you how to perform standard create, read, update and delete (CRUD) operations in your Apache Cassandra® database.

When you want to build a world-class app, you need to think about scalability, availability, and performance. So you’re probably looking for a cloud-native solution. And a run-of-the-mill database won’t cut it for your backend.

For many of your scalable application needs, Cassandra is a one-stop solution. It can give you the fastest lookup speed. And since it can be globally distributed, it’s highly available for your clients no matter where they are located.

Cassandra requires a fair amount of expertise and effort to run. So the Cassandra experts at DataStax created Cassandra-as-a-service called Astra DB. Standard API access lets you get up and running with Cassandra in minutes and enjoy all the benefits with none of the hassle. Now, you can try it out in the scenario we’ve created to help you get started using this API right in your favorite browser.

In this scenario, you’ll learn the basics of how to use the Stargate REST API built on Cassandra. Specifically, we’ll show you how to use the REST API to create tables in your Cassandra database and perform CRUD operations on them using client URL (cURL).

The technologies we’ll use in this scenario are:

  • Astra DB: Serverless cloud database-as-a-service based on Cassandra.
  • Stargate REST API: Most common API for handling app data.
  • Apache Cassandra®: Open-source database management system.

Creating a Cassandra Database with Astra DB

Cassandra is what we’ll be basing your database on, so you get the best options of high performance, scalability, throughput, and availability. Cassandra is a free and open-source database management system. It has been used by hundreds of companies to support data-driven, mission-critical applications that frequently require a global scale. For example, Cassandra is used by Apple, eBay, Hulu, Instagram, Netflix, Spotify, and Uber, just to name a few.

Unfortunately, Cassandra, being a distributed database that runs on large clusters, can be complicated to operate. That’s no issue in the big corporations with experienced engineers with time to focus solely on their databases. But it might be an issue for you. We know a lot of developers want to use Cassandra without having to start from scratch on their own.

That’s why we built Astra DB. It’s a cloud database-as-a-service (DBaaS) built on Cassandra. We designed it to make it easy and fast to start building apps that can scale fast. You can get started for free and pay as you go, once you are ready to go into production.

Using the Stargate REST API

To make it easy for your app to interact with the database, we created Stargate.io. It’s an open-source data gateway with three APIs that work with Astra DB right out of the box. Instead of having to read up on different APIs and databases, all you have to do is pick one of the three Stargate APIs and get to work on your application.

You can read more about the GraphQL API and Document API in the intro post to this series and the following posts that will take a closer look at each of them. For now, we’ll focus on the REST API, which is the most commonly used.

The REST API concept has been around for over 20 years now. It’s still popular because it’s so easy to use. It lets you use standard HTTP commands like POST, PUT, GET, and DELETE to exchange data in JavaScript Object Notation (JSON) or other formats that are well-known to most developers.

Image description

With the Stargate REST API, you can implement your application and Cassandra database separately. You can then use the API to call on microservices between the two. The clean cuts between all your moving parts make it easier for you to scale whatever it is you’re building. You can even use our REST API to create new tables in your database.

Image description

Try out the Stargate REST API in your browser

We’ve set up a scenario for you to try out the Stargate REST API for free. You can use the REST API Katacoda scenario to set up a world-class, cloud-native database and perform CRUD operations on your data in just a matter of minutes — all within your browser of choice.

Learn more about Astra by also going through our other scenarios on our developer portal.

All you need to do is sign up for an Astra account to start writing and reading data. DataStax gives you a free credit of USD 25 every month so you can check it out without entering any credit card details. If you experience any friction in the sign-up process, have a look at this short guide.

Sign up for an Astra DB account today and get started with the Stargate REST API in a matter of minutes.

References

  1. What is Astra DB? (Astra documentation)
  2. Get a head start on your app development with DataStax Stargate APIs
  3. Astra Katacoda scenarios
  4. Astra Youtube tutorials
  5. DataStax Developer Portal
  6. Join our Discord: Fellowship of the (Cassandra) Rings
  7. Stargate APIs | GraphQL, REST, Document
  8. DataStax Academy
  9. DataStax Certifications
  10. DataStax Workshops

Top comments (0)