Welcome to the Graph Streaming and Quine* workshop! In this two-hour workshop, we show how to combine scalable database as Apache Cassandra™
with a poweful realtime graph engine Quine
.
Using Astra DB, the cloud based Cassandra-as-a-Service platform delivered by DataStax, we will cover the very first steps for every developer who wants to try to learn a new database: creating tables and CRUD operations.
It doesn't matter if you join our workshop live or you prefer to do at your own pace, we have you covered. In this repository, you'll find everything you need for this workshop:
- Objectives
- Frequently asked questions
- Materials for the Session
- Create your Database
- Setup Quine
- Graph Exploration
- Homework
- What's NEXT
1️⃣ Give you an understanding and how and where to position Apache Cassandra™
2️⃣ Give an overview of the NoSQL ecosystem and its rationale
3️⃣ Provide an overview of Cassandra Architecture
4️⃣ Make you create your first tables and run your first statements
🚀 Have fun with an interactive session
1️⃣ Can I run this workshop on my computer?
There is nothing preventing you from running the workshop on your own machine. If you do so, you will need the following:
- git installed on your local system
2️⃣ What other prerequisites are required?
- You will need enough *real estate* on screen, we will ask you to open a few windows and it would not fit on mobiles (tablets should be OK)
- You will need an Astra account: don't worry, we'll work through that in the following
- As "Intermediate level" we expect you to know what java and Spring are.
3️⃣ Do I need to pay for anything for this workshop?
No. All tools and services we provide here are FREE. FREE not only during the session but also after.
4️⃣ Will I get a certificate if I attend this workshop?
Attending the session is not enough. You need to complete the homework detailed below and you will get a nice badge that you can share on linkedin or anywhere else *(open badge specification)*
It doesn't matter if you join our workshop live or you prefer to work at your own pace, we have you covered. In this repository, you'll find everything you need for this workshop:
ASTRA DB
is the simplest way to run Cassandra with zero operations at all - just push the button and get your cluster. No credit card required, 40M read/write operations and about 80GB storage monthly for free - sufficient to run small production workloads. If you end your credits the databases will pause, no charge
Leveraging Database creation guide create a database. Right-Click the button with Open in a new TAB.
Field | Value |
---|---|
Database Name | workshops |
Keyspace Name | quine |
Regions | Select GOOGLE CLOUD , then an Area close to you, then a region with no LOCKER 🔒 icons, those are the region you can use for free. |
ℹ️ Note: If you already have a database
workshops
, simply add a keyspacequine
using theAdd Keyspace
button on the bottom right hand corner of db dashboard page.
While the database is being created, you will also get a Security token:
save it somewhere safe, as it will be needed to later in others workshop (In particular the string starting with AstraCS:...
.)
The status will change from Pending
to Active
when the database is ready, this will only take 2-3 minutes. You will also receive an email when it is ready.
These instructions were written using Java 11.10.
Follow the Download Quine page to download the JAR. Choose/create a directory for Quine, and copy the JAR to this location:
mkdir ~/local/quine
cp ~/Downloads/quine-1.2.1.jar ~/local/quine
✅ Step 3 Configuration
Create a quine.conf
file inside the quine directory:
cd ~/local/quine
touch quine.conf
Edit the quine.conf
file to look like the following:
quine.store {
# store data in an Apache Cassandra instance
type = cassandra
# the keyspace to use
keyspace = quine
should-create-keyspace = false
should-create-tables = true
replication-factor = 3
write-consistency = LOCAL_QUORUM
read-consistency = LOCAL_QUORUM
local-datacenter = "us-east1"
write-timeout = "10s"
read-timeout = "10s"
}
datastax-java-driver {
advanced {
auth-provider {
class = PlainTextAuthProvider
username = "token"
password = "AstraCS:qFDPGZEgBlahBlahYourTokenGoesHerecff15fc"
}
}
basic {
cloud {
secure-connect-bundle = "/Users/aaronploetz/local/secure-connect-bundle.zip"
}
}
}
Astra-Specific Settings:
type = cassandra
- If the type is not specified, Quine defaults to use RocksDB.
should-create-keyspace = false
- Remember keyspaces can only be created in Astra via the dashboard.
replication-factor = 3
- Defaults to 1 if not set, which will not work with Astra DB.
write-consistency = LOCAL_QUORUM
- Minimum consistency level required by Astra.
read-consistency = LOCAL_QUORUM
- Minimum consistency level required by Astra.
local-datacenter = "us-east1"
- Set your Astra DB cloud region as the local DC.
username = "token"
- No need to mess with this. Just leave it as the literal word "token."
password
- A valid token for an Astra DB cluster.
secure-connect-bundle
- A valid, local file location of a downloaded Astra secure connect bundle. The driver gets the Astra DB hostname from the secure bundle, so there is no need to specify endpoints separately.
To run Quine, invoke the JAR with Java, while passing the quine.conf
in the config.file
JVM parameter:
java -Dconfig.file=quine.conf -jar quine-1.2.1.jar
If Quine starts correctly, it should produce output similar to below:
2022-06-15 15:11:52,666 WARN [NotFromActor] [s0-io-4] com.datastax.oss.driver.internal.core.cql.CqlRequestHandler - Query '[0 values] CREATE TABLE IF NOT EXISTS journals (quine_id blob,timestamp bigint,data blob,PRIMARY KEY(quine_id,timestamp)) WITH CLUSTERING ORDER BY (timestamp ASC) AND compaction={'class':'TimeWindowCompactionStrategy'}' generated server side warning(s): Ignoring provided values [compaction] as they are not supported for Table Properties (ignored values are: [additional_write_policy, bloom_filter_fp_chance, caching, cdc, compaction, compression, crc_check_chance, dclocal_read_repair_chance, extensions, gc_grace_seconds, id, max_index_interval, memtable_flush_period_in_ms, min_index_interval, nodesync, read_repair, read_repair_chance, speculative_retry])
Graph is ready!
Application state loaded.
Quine app web server available at http://0.0.0.0:8080
You can now use Quine's visual graph explorer in a web browser, and create/traverse data with either Gremlin or Cypher: http://localhost:8080/
todo
To submit the homework,
todo
We've just scratched the surface of what you can do using Astra DB, built on Apache Cassandra. Go take a look at DataStax for Developers to see what else is possible. There's plenty to dig into!
Congratulations: you made to the end of today's workshop.
... and see you at our next workshop!
Sincerely yours, The DataStax Developers