Get a Head Start on Your App Development with Flexible DataStax Stargate APIs
Published: 2022-06-09 20:35:56

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3mmfidu2exf7df2ldjdp.jpeg)


_This is the introductory blog to explain our upcoming series about the [Stargate Data APIs](https://www.datastax.com/products/datastax-astra/apis). Each post will take you on a deeper dive into how each application's programming interface (API) works and what you’ll want to use it for._

If you want to build an enterprise-level app that can handle as much data as Apple, Netflix, or [Capital One](https://www.datastax.com/enterprise-success/capital-one), you’ll need to run it on [Apache Cassandra®](https://www.datastax.com/what-is/cassandra) as they do.

But you no longer have to have a huge team of developers. We’ve created the project [Stargate](https://stargate.io/) to help you. Stargate is an open-source data gateway that brings together your app and databases by helping to abstract Cassandra-specific concepts from app developers. It’s also an important part of [DataStax Astra DB](https://astra.dev/3wVm1Xo), our multi-region, multi-cloud, serverless database service built on Apache Cassandra.

With the three [Stargate APIs](https://www.datastax.com/products/datastax-astra/apis), REST, Document, and GraphQL, you have all you need to manage your Cassandra database without having to build your own Cassandra-specific interface.


# How you will benefit from the Stargate Data APIs

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gb3m67ulnxgzszswyw2v.png)

Figure 1: The most common DataStax API on Stargate — REST API — lets apps run seamlessly with Cassandra in addition to any relevant microservices.

It can be challenging to work out exactly how to retrieve and update data when you’re working on a new app. You may want to pull from several microservices like payments, analytics, and a user action log.

Instead of having to sort through drivers or even code your own interface between all of your moving parts and your database, you can continue to use APIs and technologies you’re already familiar with (like REST) via the Stargate APIs.

They will let you set up the interface between your app and its data in a Cassandra database with minimal work on your behalf. Even if your app is already up and running.

You’ll get all the benefits of scalability without the hazard of your interface breaking down when your app starts to attract a lot of users. Plus you won’t have to deal with the other common concerns like health checks, metrics, or authentication as these are all provided out of the box.


# Be up and running in seconds with the Stargate REST API

REST APIs have become very popular because they effectively cover the needs for basic HTTP operations.

With the Stargate REST API, you get the most popular, well-known interface with a Cassandra database that’ll work no matter how big your app grows to be. You can use it to get a clean separation between your app and the server that holds your data.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xsfhbqdk1p55u1xtwy8o.png)

Figure 2: DataStax Stargate REST API comes with all Astra databases. You can set one up for free at [astra.datastax.com](https://astra.dev/3wVm1Xo).

Since you’re probably already familiar with REST APIs, you can get up and running in seconds with the Stargate REST API. To start, simply set up a database for free in [DataStax Astra DB](https://astra.dev/3wVm1Xo).

You can use the Stargate REST API to cover a wide range of use cases. For example, managing a product catalog and keeping it up to date with the amounts of each product in stock. Or letting librarians search for and suggest new books based on the authors or genres each visitor likes.

You can do a lot of great work with the REST API. But one of the challenges is that you can’t control the amount of data that is returned from the database. So if you need a truly scalable app that draws on the relationships between data, you’ll want to know about the [GraphQL API](https://www.datastax.com/dev/graphql).


# Only get the data you need with the Stargate GraphQL API

You might not be building one of the world’s largest social networks, but you can still enjoy the same technology that lets Facebook handle a large number of datasets.

Developers at Facebook created GraphQL to get just the pieces of data needed in every instance and make it easy to understand. That’s how we know the [Stargate GraphQL API](https://www.datastax.com/dev/graphql) will also work for you.

Without this API, this task could end up as an insurmountable mess when your app starts to gain traction with users. But with the [GraphQL API](https://www.datastax.com/dev/graphql), you can simply set it up to retrieve exactly the data you need from the start. This saves you a lot of complexity and bandwidth.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lv60ulycte4msn3wbvks.png)

Figure 3: DataStax Stargate GraphQL API comes with all Astra databases. You can set one up for free at [astra.datastax.com](https://astra.dev/3wVm1Xo).

The biggest disadvantage to GraphQL is that the possibilities can seem overwhelming. That’s why we created a thorough [GraphQL API demo](https://www.datastax.com/dev/graphql) that helps you start using it with Stargate.

Be sure to read our second blog post in this series to learn more about what makes the [GraphQL API](https://www.datastax.com/dev/graphql) so great to work with and just how to make it work for you.


# Don’t worry about the schema — just use the Document API

Modern applications are built on APIs, and JSON documents are the most common way of expressing data payloads on those APIs. [Stargate Document API](https://www.datastax.com/dev/documents-api) makes it easy to serve a document-style API directly from any Cassandra database, allowing you to store and retrieve JSON documents without defining a database schema. This is a big deal because the traditional practice for Cassandra has been to define all your schema upfront.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/etpf39trlngk8t5fm1m1.png)

Figure 4: DataStax Stargate Document API comes with all Astra databases. You can set one up for free at [astra.datastax.com](https://astra.dev/3wVm1Xo).

[Document API](https://www.datastax.com/dev/documents-api) serves up all your data as JSON documents and lets you interact with them in the most familiar HTTP methods. It also lets you represent the data just like you want it in your app. You can use this API to create, update, and retrieve documents and subdocuments.

You can get started using [Document API](https://www.datastax.com/dev/documents-api) now or read on in our third and final post in this series about the benefits and technology within our Document API.

_For exclusive posts on all things data: Cassandra, streaming, Kubernetes, and more; follow [DataStax on Medium](https://datastax.medium.com/)._

**References:**



1. [What is Astra DB? (Astra documentation)](https://docs.datastax.com/en/astra/docs/)
2. [Getting started with DataStax Astra DB](https://www.youtube.com/watch?v=MBGPLgbiKkY)
3. [Stargate APIs | GraphQL, REST, Document](https://www.datastax.com/products/datastax-astra/apis)
4. [Join our Discord: Fellowship of the (Cassandra) Rings](https://discord.com/invite/pPjPcZN)
5. [DataStax Academy](https://auth.cloud.datastax.com/auth/realms/CloudUsers/protocol/saml/clients/absorb)
6. [DataStax Certifications](https://www.datastax.com/dev/certifications)
7. [DataStax Workshops](https://www.datastax.com/workshops)
8. [DataStax for Developers](https://www.datastax.com/dev)