Pacific-Design.com

    
Home Index

1. Cassandra

2. Schema

Cassandra / Schema /

Cassandra - Schema

-- ------------------------------------------------------------------------------------------------------ --
DROP KEYSPACE IF EXISTS web_store;
CREATE KEYSPACE web_store WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
DESCRIBE KEYSPACES;
-- ------------------------------------------------------------------------------------------------------ --
CREATE TABLE IF NOT EXISTS
web_store.store (
    url       text,
    dt        timestamp,
    title     text,
    body      text,
    category  text,
    score     float,
    PRIMARY KEY (url, dt)
)
WITH comment     = 'web store'
 AND compression = { 'sstable_compression' : '' }
 AND compaction  = { 'class' :  'LeveledCompactionStrategy' };
-- ------------------------------------------------------------------------------------------------------ --
DESCRIBE web_store

References:

Time Series Data Modeling