DataStax News: Astra Streaming now GA with new built-in support for Kafka and RabbitMQ. Read the press release.

Toggle Menu

Access Cassandra Via Stargate APIs

Use REST and GraphQL to access your Cassandra database

CONTRIBUTORS

For cloud native apps, you want API access to Cassandra. Stargate gives you secure REST and GraphQL APIs.

This scenario picks up where the scenario named Managing Cassandra Clusters in Kubernetes Using the Cass-Operator leaves off. If you have not yet worked through that scenario, you may want to check it out here.

In this scenario, we'll:

  • Set up a Cassandra cluster running on Kubernetes and install the example Pet Clinic app
  • Install Stargate and get an auth token for accessing the APIs
  • Use Stargate's REST API to access Cassandra
  • Use Stargate's GraphQL Playground to explore the GraphQL interface
  • Use cURL to access Stargate's GraphQL interface

Note: As shown in previous scenarios, the Pet Clinic example app provides its own backend microservice. To keep this scenario relatively brief, we won't modify Pet Clinic app to replace the backend with the Stargate APIs. But, given more time, we could!
However, we will use the Pet Clinic table named petclinic_reference_lists. One row of this table holds the list of pet types as a Cassandra set. The primary key value for this row is pet_type. We'll use this table so you get the intuition that the Stargate APIs could provide a viable microservice for the app.

You're going to love Stargate and its APIs!

Time to Complete

20

Difficulty

Intermediate

Share