This project has a few hands on exercises to learn how to use Scylla as a programmer. You can pick between writing your code in Go, Java or Python. Should you by any chance want to use another language you are welcome to do so but any help you might need is then restricted to Scylla and CQL.
Your mission, should you choose to accept it, is to modify and extend one or several of the provided programs with the following.
- Have the program accept an argument in the form of a UUID and print just this row.
- Have the program accept an argument in the form of a UUID, an integer denoting the column and a value to update the object that this UUID corresponds to and with this new value.
- Add another table called
comments
with three columns: id, ts and comment. This table should store comments made by certain user (id) at a given time (ts). - Create crud operation to insert a comment for a user.
- Implement a way to list the comments for just one given user.
- Install Scylla Tools and put the
scylla-tools-java/bin
in your $PATH - Install Docker using your package manager of choice
- Execute
docker run --name some-scylla -d scylladb/scylla
to start Scylla - Find the IP ( from now on) number of the container like this:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' some-scylla
- Initialize the database:
cqlsh -f schema/001-init_schema.cql <HOST>
cqlsh -f ../schema/002-add_some_users.cql <HOST>
- Install Go using your package manager of choice
- Go to the directory scylla-talk-go
- Execute
go build
to produce the program executable - Run the program like this:
./scylla-talk-go -host <HOST>
- Install Maven using your package manager of choice
- Go to the directory scylla-talk-java
- Execute
mvn package
to produce the program executable - Run the program like this:
java -jar target/scylla-talk-1.0-SNAPSHOT.jar <HOST>
- Install Python using your package manager of choice
- Go to the directory scylla-talk-python
- Install the cassandra driver
sudo pip install cassandra-driver
or without sudopip install --user cassandra-driver
- Run the program like this:
python cluster.py <HOST>