Difficulty: Beginner
Estimated Time: 20 minutes

In this scenario, you'll:

  • Register for an Astra account if you don't have one
  • Create a serverless database
  • Build a React Application Tiktok Clone

📚 Datastax: Cassandra, Astra DB and Stargate

Top Level Overview of the Astra DB Stack

Sources Cassandra Documentation, Astra DB Documentation and Stargate Documentation

🔵 Cassandra: is the NoSQL Open Source Database which is the foundation of the stack. Cassandra powers many extremely large and demanding databases for enterprises around the world, and is the best option for companies needing scalability and performance.

🔵 Astra DB: provides a serverless instance of Cassandra. This comes with a free $25 credit, providing a significant amount of data and transactions. You're charged only for what you use, and there's no credit card needed.

🔵 Stargate: is an open source engine to provide APIs for Cassandra databases. It's available free for your use, and comes with every Astra DB instance.

ok

🔵 Serverless: Scale up or down without doing any work. Just work with your data, and leave the ops to us.

🔵 Free tier: We replaced our free tier with a $25/month credit which gets you a great deal of bandwidth and storage for experimenting and running small applications.

🔵 Stargate: All Cassandra instances come with Stargate included.


Ok, let's move on and get into our first lab, where we get our Astra DB instance.

Thanks for exploring the Stargate APIs! You can use these examples as a jumping off point for further learning opportunities.

C* Made Easy with Stargate and HTTPie

Step 1 of 5

Step 1

⚒️ Create your Astra DB instance

Exercise time: ~10 minutes

Objectives

In this step, we will:

  • Create an Astra DB database to store data

We will cover:

  1. Register and Sign In to Astra DB
  2. Configure and create your database
  3. Let Astra DB Start Up

One of the first things we need to do is hook up the "plumbing" of our application to talk to our back-end services, namely, our Cassandra database with Astra DB . Once this is in place, we are connected and ready to go with the services we need to power our app.

We will be making use of the Document API and REST API to connect to our Astra DB database. The Stargate API framework allows developers the freedom to access Astra DB with a variety of APIs. The REST and GraphQL APIs make it easy to interact with standard Cassandra databases. With the Document API, you can save and search schemaless JSON documents in Cassandra. No need to use SQL, CQL, or any database drivers to talk to the data layer. Just code and move on.

ahem...for those of you familiar with Apache Cassandra, yes, I just said you could skip data modeling.

Document API Flow

Register and/or Sign In to Astra DB

If you are new to Astra DB The ASTRA service is available at url https://astra.datastax.com. ASTRA is the simplest way to run Cassandra with zero operations at all - just push the button and get your cluster. Astra DB offers $25 credit/month and requires no credit card to setup. That $25 gives you a lot of storage space and transactions, and you have no worries of being accidentally charged. ### ✅ Step 1a. Use the dialogs to create an account You can use your Github, Google accounts or register with an email. Make sure to chose a password with minimum 8 characters, containing upper and lowercase letters, at least one number and special character - Registration Page Registration Image You will automatically be asked to create a database. ✅ Choose your plan: The "Pay as You Go" plan gives you $25/month of traffic and storage, and does not require a credit card - if you get close to the limit we'll let you know. Click "Get Started." ✅ Name your Database: With our new serverless plan you can have as many databases as you need. For this workshop, use "workshops" as the database name and "httpie" as the Keyspace name.
✅ 4. Select a cloud provider: You can use either GCP or AWS. Chose a region that's geographically close to you. ✅ 5. Click Create Database
If you already have an account ### ✅ Log in to Astra DB - Log in to Astra DBCreate database: Click the "Create Database" button in the left hand pane. ✅ Choose your plan: The "Pay as You Go" plan gives you $25/month of traffic and storage, and does not require a credit card - if you get close to the limit we'll let you know. Click "Get Started." ✅ Name your Database: With our new serverless plan you can have as many databases as you need. For this workshop, use "workshops" as the database name and "httpie" as the Keyspace name.
✅ 4. Select a cloud provider: You can use either GCP or AWS. Chose a region that's geographically close to you. ✅ 5. Click Create Database

Let Astra DB Start Up

Honestly, there's not much to do here, but wait a couple minutes for your Astra DB database to start up. Once completed, you will have a fully managed Apache Cassandra database ready to rock and power your app.

You will see your new database Pending or Initializing in the Dashboard. image

The status will change to Active when the database is ready, this will only take 2-3 minutes and you will also receive an email when it is ready.

Awesome! While you are waiting for your database to startup feel free to move to the next section.