我正在尋找存儲時間序列數據在Apache Cassandra的實例Apache的卡桑德拉 - 列的值時間軸
我讀過the guides from DataStax但不幸的是,他們是從2012年不過我覺得基本原則仍然適用 - 我只是想知道如何用最新版本的Cassandra(v3.11)來做到這一點。
我有一個表目前是這樣的:
CREATE KEYSPACE IF NOT EXISTS tick_data
WITH REPLICATION = {'class': 'SimpleStrategy',
'replication_factor': 1};
USE tick_data;
CREATE TABLE IF NOT EXISTS minute_bars (
contract_id text,
bar_time timestamp,
bar text,
PRIMARY KEY (contract_id, bar_time)
);
插入一些數據,並通過cqlsh
連接我可以查看數據和前幾行之後是這樣的:
contract_id | bar_time | bar
-------------+---------------------------------+--------------------------------------------------------------------------------------------
1 | 2017-07-21 14:05:00.000000+0000 | {'open': 0.15, 'high': 0.15, 'low': 0.15, 'close': 0.15, 'volume': -1, 'barCount': -1}
1 | 2017-07-21 14:10:00.000000+0000 | {'open': 0.15, 'high': 0.15, 'low': 0.15, 'close': 0.15, 'volume': -1, 'barCount': -1}
1 | 2017-07-21 14:15:00.000000+0000 | {'open': 0.15, 'high': 0.15, 'low': 0.15, 'close': 0.15, 'volume': -1, 'barCount': -1}
1 | 2017-07-21 14:20:00.000000+0000 | {'open': 0.15, 'high': 0.15, 'low': 0.15, 'close': 0.15, 'volume': -1, 'barCount': -1}
1 | 2017-07-21 14:25:00.000000+0000 | {'open': 0.15, 'high': 0.15, 'low': 0.15, 'close': 0.15, 'volume': -1, 'barCount': -1}
1 | 2017-07-21 14:30:00.000000+0000 | {'open': 0.15, 'high': 0.15, 'low': 0.15, 'close': 0.15, 'volume': -1, 'barCount': -1}
爲了獲得Apache Cassandra的好處在處理時間序列數據時,什麼是存儲時間軸數據的最新過程?