In this blog, we will introduce DataStax Astra’s REST API. A video is embedded in the blog if you want to watch a live demo where we build a very simple shopping list app with CRUD operations using DataStax Astra’s REST API on Gitpod. The repository we used is linked here.
If you have been following us here at Anant, then you know that we have already worked with DataStax Astra and created an open source application that you can use to quickly try Astra out. The repo can be found here: https://github.com/Anant/cassandra.api. Also, you can check out some blogs and webinars that we have done in conjunction with this repo and DataStax Astra below.
- Cassandra.API Documentation Walkthrough
- Cassandra.API Blog Post: Part 1
- Cassandra.API Blog Post: Part 2
- Building a REST API with DataStax Astra using Node & Python: Part 1
- Building a REST API with DataStax Astra using Node & Python: Part 2
- Cassandra.API Live Workshop w/DataStax
- Cassandra.API Video Demo: Part 1
- Cassandra.API Video demo: Part 2
- Cassandra as a Service in the Cloud
Unlike for Cassandra.API, where we used the Python and Node.js drivers to connect to Astra, we used Astra’s REST API to connect to Astra for this basic CRUD shopping list app.
In this app, we have 2 directories: Template and Completed (Not Refactored). The template directory contains a boilerplate React app that we used to build the app that exists in the Completed directory. If you want to watch how we build it live, check out the embedded video below!
DataStax Astra’s REST API allows users to interact with the following database objects:
- Tables: Create, update, and delete tables within a keyspace.
- Columns: Add, update, and delete columns in a table.
- Rows: Add, update, and delete rows in a table.
For this basic shopping list app, we mainly interacted with the rows objects:
- CREATE: Add items using id and item name
- READ: Get items
- UPDATE: Edit items names based on id
- DELETE: Delete items based on id
More specific information about the REST API can be found in the documentation linked here.
If you want to try out the shopping list app yourself, you can check out the README.md on the repo and start the app on Gitpod with gitpod.io/#https://github.com/adp8ke/DataStax-Astra-REST-API-Shopping-List
As mentioned above, we have a live demo where we build this CRUD shopping list app embedded below. While you’re watching, don’t forget to hit Like and Subscribe!
Cassandra.Link
Cassandra.Link is a knowledge base that we created for all things Apache Cassandra. Our goal with Cassandra.Link was to not only fill the gap of Planet Cassandra, but to bring the Cassandra community together. Feel free to reach out if you wish to collaborate with us on this project in any capacity.
We are a technology company that specializes in building business platforms. If you have any questions about the tools discussed in this post or about any of our services, feel free to send us an email!