Cassandra!
Item
Item
Feature
Item
Item
Feature
Feature
Screen
Item
Item
Feature
Item
Item
Feature
Feature
Screen
App
https://github.com/hannelita/neo4j_doc_manager
CREATE TABLE playlist.statistics:
counter_name text PRIMARY KEY: {i}
counter_value counter: {p}
CREATE TABLE playlist.track_by_artist:
artist text: {r}
track text: {p}
track_id uuid: {i}
genre text: {p}
music_file text: {p}
starred boolean: {p}
track_length_in_seconds int: {p}
PRIMARY KEY (artist {i}, track {p}, track_id {i})
Get a Cassandra Schema
Specify which are properties, or nodes or relationships
CREATE TABLE playlist.statistics:
counter_name text PRIMARY KEY: {i}
counter_value counter: {p}
CREATE TABLE playlist.track_by_artist:
artist text: {r}
track text: {p}
track_id uuid: {i}
genre text: {p}
music_file text: {p}
starred boolean: {p}
track_length_in_seconds int: {p}
PRIMARY KEY (artist {i}, track {p}, track_id {i})
Node Labels
CREATE TABLE playlist.statistics:
counter_name text PRIMARY KEY: {i}
counter_value counter: {p}
CREATE TABLE playlist.track_by_artist:
artist text: {r}
track text: {p}
track_id uuid: {i}
genre text: {p}
music_file text: {p}
starred boolean: {p}
track_length_in_seconds int: {p}
PRIMARY KEY (artist {i}, track {p}, track_id {i})
Node Properties:
flexible
CREATE TABLE playlist.track_by_artist:
artist text: {r}
track text: {p}
track_id uuid: {i}
genre text: {p}
music_file text: {p}
starred boolean: {p}
track_length_in_seconds int: {p}
PRIMARY KEY (artist {i}, track {p}, track_id {i})
CREATE TABLE playlist.track_by_id:
track_id uuid PRIMARY KEY: {u}
artist text: {r}
genre text: {p}
music_file text: {p}
track text: {p}
track_length_in_seconds int: {p}
Relationship
CREATE TABLE playlist.track_by_artist:
artist text: {r}
track text: {p}
track_id uuid: {i}
genre text: {p}
music_file text: {p}
starred boolean: {p}
track_length_in_seconds int: {p}
PRIMARY KEY (artist {i}, track {p}, track_id {i})
CREATE TABLE playlist.track_by_id:
track_id uuid PRIMARY KEY: {u}
artist text: {r}
genre text: {p}
music_file text: {p}
track text: {p}
track_length_in_seconds int: {p}
Relationship
CREATE TABLE playlist.track_by_artist:
artist text: {r}
track text: {p}
track_id uuid: {i}
genre text: {p}
music_file text: {p}
starred boolean: {p}
track_length_in_seconds int: {p}
PRIMARY KEY (artist {i}, track {p}, track_id {i})
CREATE TABLE playlist.track_by_id:
track_id uuid PRIMARY KEY: {u}
artist text: {r}
genre text: {p}
music_file text: {p}
track text: {p}
track_length_in_seconds int: {p}
Uniques and Indexes
CREATE TABLE playlist.playlist_tracks:
username text: {p}
playlist_name text: {p}
sequence_no timestamp: {p}
artist text: {r}
genre text: {p}
track_id uuid: {i}
track_length_in_seconds int: {p}
track_name text: {p}
PRIMARY KEY ((username {p}, playlist_name {p}) {p}, sequence_no {p})
Also works for inline schema
Questions?
hannelita@gmail.com
@hannelita