Accessing Cassandra with the Stargate REST API
REST APIs are a popular way to expose interfaces in microservice and cloud-native architectures. Stargate makes it easy to serve a RESTful API directly from any Cassandra database, allowing you to access data by translating CQL into simple HTTP operations.
What Is A RESTful API?
REST stands for Representational State Transfer. The RESTful API style was invented by Roy Fielding and his colleagues in 2000 as a way of using standard HTTP commands like POST, PUT, GET, DELETE, and others to support the exchange of data using formats such as JSON. This style of interface promotes a clean separation between the implementation of clients and servers. Over time the RESTful style has emerged as the most common way of specifying interfaces for stateless microservices that can scale independently and store their data in databases like Cassandra.
Next concept: Why use the REST API with Cassandra?Why Use The REST API With Cassandra?
REST is the most popular API style, so you get all the benefits of scale with a well understood interface pattern. Also helpful when drivers or gRPC clients aren’t available for your language, or language version.
When the Stargate REST API is added to an existing Cassandra deployment, it automatically creates HTTP endpoints that allow you to perform create, read, update, and delete (CRUD) operations on tables in your database. You can also create new database tables directly via the API.
How To Get The Stargate REST API
Stargate is an open-source data gateway and is automatically available as a managed service in DataStax Astra. If you already have an Astra database, the Stargate REST API is already enabled. If you have access to your own self-hosted Cassandra cluster, see the Stargate documentation for the quickstart guide for installing and using the REST API. Stargate is also distributed with K8ssandra.io for Kubernetes users and included in DataStax Enterprise.
Next: Try it outTry It Out
With the Stargate REST API you can serve RESTful APIs directly from Cassandra, allowing you to execute common CQL operations. Here’s two ways you can try it yourself.
Explore The Stargate REST API In DataStax Astra With This Next.Js Starter App.
More Resources
Items related to Stargate REST API
Stargate Discord Server
Join our discord room to chat with the contributors and meet the community.
Start Learning