Monday, May 4, 2015

Strata workshop: Getting started with Cassandra

Downloading and installing Cassandra:

Linux/Mac:
curl -L http://downloads.datastax.com/community/dsc-cassandra-2.1.4-bin.tar.gz | tar xz

(or use home brew)

Then run:

./bin/cassandra

To start Cqlsh (may need to install Python)

./bin/cqlsh

Windows:
http://planetcassandra.org/cassandra/ or grab a USB key from me.

Workshop code (we may not get to this):

Cql docs:

Cassandra docs:

Java Driver Docs:

Data modelling exercises:

First create the keysapce:


CREATE KEYSPACE killrauction WITH replication = {'class': 'SimpleStrategy' , 'replication_factor': 1 };

1) Get into CQLSH and create a table for users
- username
- firstname
- lastname
- emails
- password
- salt for password

2) Auction item table (no bids)
- name
- identifier?
- owner
- expiration

3) The bids

Data:
 - item identifier
 - bid time
 - bid user
 - bid amount

Considerations
 - Avoid sorting in the application
 - Two bids the same price?
 - Really fast sequential access
 - Current winner?

No comments: