What is Stargate?
Stargate is a data API gateway for Apache Cassandra that completes the transformation of the Apache Cassandra powerhouse database to a cloud service that simplifies data access and management.
What is Stargate?
Stargate is a data API gateway for Apache Cassandra. It supports native drivers, and elevates gRPC to native-driver-level performance while modernizing Apache Cassandra for other web APIs and JSON. With Stargate, your Cassandra database is automatically available with a schemaless JSON document interface using the Document API. Alternative CQL interfaces via HTTP APIs like gRPC, REST, and GraphQL are also provided automatically. It deploys, among many other options, as Docker containers. Stargate upgrades Cassandra performance by separating storage, coordinator and API Service nodes into independently scalable/deployable containers. It is also extensible for new APIs!
Apache Cassandra with Stargate
Stargate enhances Cassandra deployments by simplifying both development and operations:
Feature | Benefit |
---|---|
Schemaless JSON Document API that transforms Cassandra into a document database. | Schemaless development and JSON support without requiring a new DBMS platform. JSON schema is also supported for semi or well-structured JSON. |
High-performance CQL over gRPC that comprehensively exploits gRPC unary, client-side streaming, server-side streaming, and bidirectional calls, plus protobuf. | Driver level wire speed over HTTP/2 and easier to learn than native drivers: no connection pooling, TLS, authentication, load balancing, retry policies, write coalescing, compression, health checks, etc. |
Alternative CQL interfaces over web APIs like REST, and GraphQL. | Use familiar APIs to make CQL more approachable to newcomers, provide a connectivity method when there aren’t supported clients for your language. |
Automatically serving data access layer over popular HTTP APIs like JSON Document, REST, GraphQL, and gRPC. | Less boilerplate data access code to write, Connectivity options for languages or language versions unsupported by drivers. |
Separating coordinator and storage nodes into independently deployable and scalable services. | Efficient scaling for cluster performance with apps using native drivers, gRPC. Fine-tune workloads that are query-intensive, or storage intensive. |
Separating API Services into independently deployable and scalable services. | Efficient scaling for application performance with apps using Document, REST, GraphQL APIs. Fine-tune workloads by the API they use. |
Table-based and JWT-based token authentication for driver and API connections. | Enhances Cassandra basic auth with token authentication for Cassandra clients via Keycloak. |
Deployment to bare metal, VMs, Docker, GKE, EKS, K8ssandra, DSE, Astra DB. | Stargate is ready for modern CI/CD and release automation, regardless of the ops approach. Or, just get stargate-as-a-service with DataStax Astra DB. |
Download our free infographic to learn more about how Stargate has changed overtime
Stargate APIs
Stargate coordinator nodes handle native driver and gRPC connections, while separate API Service nodes handle JSON Document, CQL over REST, and GraphQL API traffic. Balance a range of requirements across performance and productivity and bring the right tool to the right use case with Stargate’s APIs.
Stargate REST API
No driver for your language or language version? Serve RESTful APIs automatically from any Cassandra database and invoke CQL operations over HTTP.
Stargate Document API
Save and search schemaless JSON documents over HTTP in Cassandra using the Document API, without defining a schema upfront. Got semi-structured or well-structured JSON? No sweat, JSON schema has you covered.
Stargate GraphQL API
Write flexible and performant Cassandra queries in GraphQL to access only the data your applications need. Develop in CQL-first or schema-first modes.
Stargate gRPC API
gRPC offers native-driver-level performance over HTTP(S). Create language-specific queries using CQL with any Cassandra deployment in Rust, GoLang, NodeJS and Java. Easily generate clients for other supported gRPC languages.
Drivers and APIs
As you consider your options for modernizing Cassandra with Stargate, you’ll want to understand the available tradeoffs of developer productivity, flexibility, and performance. Here is a brief look at the drivers and APIs Stargate currently supports, along with some guidance for choosing each path.
Native Drivers/CQL
This is what traditional backend developers will use for high-performance apps that aren’t cloud native or real-time. Coordinator nodes join the Cassandra ring and offload storage nodes by directing native driver traffic. Check out the top 10 most common CQL commands to get the syntactic glimpse of what working with denormalized, structured data looks like in a wide-column NoSQL database like Apache Cassandra.
CQL over gRPC
This should be the default approach for backend developers with Rust, goLang and Java apps. Best for latency-sensitive apps, microservices and serverless functions. gRPC provides native driver wire speed, and handles native driver tasks like connection pooling, TLS, authentication, load balancing, retry policies, write coalescing, compression, and health checks automatically so it’s easier to learn vs. drivers.
GraphQL API
Great for frontend developers, and general app, microservice or serverless function development! Of course, this is useful when Cassandra needs to participate in GraphQL query path, or when your project has chosen GraphQL over a purely RESTful approach. Usable in both schema-first and cql-first modes.
CQL over REST
Great for frontend developers. Offers the greatest level of portability and accessibility for all languages, and helpful when you don’t have a supported driver or gRPC client for your language, or language version.
JSON Document API
Great for frontend developers and the easiest possible development path. Use when you have unstructured data, or when you are doing initial development and don’t want to invest the effort in data modeling and schema definition yet. For apps with semi or well-structured JSON, JSON schema support in Stargate facilitates easier testing, data validation and API documentation.
Learn more about freedom of choice on the DevMio Blog.
HTTP Ecosystem and Stargate
HTTP is what the internet runs on, and has for some time. Its maturity and pervasiveness created a rich ecosystem of tools already available for developers, operators, network geeks, and more. It’s also the most cloud-friendly protocol for firewalls, L7 load balancers and the like. From Wireshark to Jager/Zipkin tracing, cURL to Postman, interacting with Databases over HTTP opens your app-to-database interactions to a rich ecosystem, while simplifying app and service integration.
Postman
Postman is a widely-used collaboration platform for API development and testing. Using this third-party tool, you can easily test APIs with environments generated for your test platforms and imported testing collections of API queries. Postman collections are composed of REST, Document, or GraphQL schema and queries to run or test against one or more defined environments. The tool includes a collection runner testing utility for testing against query assertions embedded in the collection. While collections and environments can be imported or exported with Postman, they are pre-loaded for you on the Postman API Network. Try our collections on DataStax Astra DB so you can skip the download/configuration, as both Cassandra and Stargate are set up for you, and it’s free on the cloud!
Learn more by visiting the DataStax Teamspace on the Postman API Network
HTTPie
cURL is awesome, but it’s a bit verbose. Boil out repetitive parameters into .rc files like (~/.astrarc), which, in this case, can keep track of your DB, cloud region, username, and password, as well as auto-refreshing your token. You can have as many sections in this file as works for you—it’s just an INI-style configuration file. Bounce around between REST and GraphQL queries, get nicely formatted JSON results, and perhaps use jq to pare them down—with less code than cURL!
Learn more about HTTPie and Stargate on Astra DB, on the DataStax Blog
Where is Stargate headed next?
At DataStax, we’re working hard with the open-source community to extend the workloads for which Apache Cassandra is suitable.
Cassandra has traditionally been known as an extremely powerful database that stands up to the most demanding use cases, but can be challenging for SQL/RDBMS developers to approach for the 1st time. DataStax is committed to working with the Stargate and Cassandra communities to make Cassandra-based systems easier to use, adopt, and extend for your needs.
Here are some of the ideas we’re exploring:
- Dynamo DB API for Apache Cassandra (part 1)
- Dynamo DB API for Apache Cassandra (part 2)
- Other APIs we haven’t thought of yet
- Exploring ODM compatibility (Object Document Mappers)
- Exploring OxM compatibility (Object Database Mapping)
How can I get started?
If you’d like to learn more about Stargate, we have several resources here to get you started:
- Stargate.io: Learn everything you need to get up to speed on all things Stargate
- Join the Stargate Discord Server: Join our discord room to chat with the contributors and meet the community
- Join the Community: Learn about how you can get involved in the Stargate project