-
Notifications
You must be signed in to change notification settings - Fork 12
LAB2_Create your Astra instance
Objectives
In this step, we will:
- Create an Astra database to store game documents
We will cover:
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 and Netlify. Once this is in place, we are connected and ready to go with the services we need to power our app.
We will also be making use of the Document API to connect to our Astra database. The Stargate API framework allows developers the freedom to access Astra with a variety of APIs, the Document API being one. 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.
ehem...for those of you familiar with Apache Cassandra, yes, I just said you could skip data modeling.
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
offers 5 Gb Tier Free Forever and you don't need a credit card or anything to sign-up and use it.
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
✅ 1. Select the free tier: 5GB storage, no obligation
✅ 2. Select a cloud provider: The free tier only allows GCP, other tiers will allow the other vendors.
✅ 3. Select the region: This is the region where your database will reside physically (choose one close to you or your users). For people in EMEA please use europe-west1
idea here is to reduce latency.
✅ 4. Click Configure Database
Note: The cloud provider GCP
is chosen by default when using the FREE tier. Paid tiers allow provider choice.
Note: We've given you all of the values you need with each instruction. While Astra allows you to fill in these fields with values of your own choosing, please follow our reccomendations to make the rest of the exercises easier to follow. If you don't, you are on your own! :)
✅ 5. Fill in the database name - battlestax_db
.
✅ 6. Fill in the keyspace name - battlestax
. It's really important that you use the name battlestax here in order for all the exercises to work well. We realize you want to be creative, but please just roll with this one today.
✅ 7. Fill in the Database User name - battle_user
. Note the user name is case-sensitive. Please use the case we suggest here.
✅ 8. Fill in the password - battle_password1
. Fill in both the password and the confirmation fields. Note that the password is also case-sensitive. Please use the case we suggest here.
✅ 9. Create the database. Review all the fields to make sure they are as shown, and click the Create Database
button.
Honestly, there's not much to do here, but wait a couple minutes for your Astra 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
in the Dashboard.
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.
🏠 Home
Introduction to the JAMStack Why this is cool ? Introduction to Netlify Want to learn more ? 🛠️ II - Setup and deploy your first app
Create your BattleStax repository Setup Netlify account Summary 🛠️ III - Create your Astra instance
Register and Sign In to Astra Configure and create your database Activate Cassandra awesome 📚 IV - What can Netlify do for you
Build, Package, deploy, host Advanced features Netlify Functions Want to learn more 🛠️ V - Expose your "hello world" API
Setup your environment Make a serverless endpoint using Netlify functions Merge back to master Check your deployment in Netlify Summary 📚 VI - What are DataStax Astra and Stargate
Introduction to Astra Introduction to Stargate Want to know More 🛠️ VII - Set environment variables in your application
Creating the .env file Explore the API with HTTPie 🛠️ VIII - Set secrets in GitHub for CI/CD
Configure secrets in GitHub Verify your secrets How is this all working ? 🛠️ IX - Set environment variables in Netlify
Set environment variables in Netlify Verify your environment variables Summary 🛠️ X - Implement a CRUD Api in Astra
Creating the insertGame Netlify endpoint Connect to Astra Hook it all together Running TDD tests 🛠️ XI - Verify and Deploy in Netlify
Merge back to master Verify your deployment in Netlify Feel the enormity of your accomplishment Super secret full game option 📚 XII - Resources