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?

1 comment:

Unknown said...

Thanks for sharing, nice post! Post really provice useful information!

Hương Lâm chuyên cung cấp máy photocopy, chúng tôi cung cấp máy photocopy ricoh, toshiba, canon, sharp, đặc biệt chúng tôi có cung cấp máy photocopy màu uy tín, giá rẻ nhất.