Database Reference
In-Depth Information
cqlsh:mastering_cassandra> SELECT * FROM demo_wide_row
WHERE id = '2014-09-04+0000' AND city > 'Baltimore' AND
city < 'Rockville';
id | city | hits
--------------------------+----------+------
2014-09-04 05:30:00+0530 | Bethesda | 5
2014-09-04 05:30:00+0530 | NY | 1
(2 rows)
However, this is not the only way to get range queries working. We will say later that we
could do the same using a secondary index. So, why wide rows? Wide rows are tradition-
ally useful for things like data series. An example of data series is time series where data
is ordered by time such as a Twitter feed or Facebook timeline. In these cases, you may
have user_id as a row key (partition key, which is the first component of a composite
key), and timestamp as the cell names (the second component of a composite key), and
the cell value is the data (a tweet or a timeline item).. It can be used to store sensor data in
your Internet of Things application where row-key, cell name, and cell data are sensor ID,
timestamp of data generated, and data from the sensor, respectively.
Search WWH ::




Custom Search