This sample shows how to work with time series data in ScyllaDB using the Scylla Python Driver.
The following scripts performs the following:
- Create the schema (keyspace, table and secondary indexes)
- Emulate 10K sensors, each sensor emitting 2000 data points, while using prepared statements
Pre-requisites
First, spin a fresh ScyllaDB Cluster:
docker run --name nodeX --publish '9042:9042' --rm -d scylladb/scylla:6.0.1 --overprovisioned 1 --smp 1
Then, make sure to install our Driver into your Python environment:
pip install scylla-driver
and run the script:
python timeseries.py -c localhost &
Tip
If you're running a cluster instead a single ScyllaDB node, you can add other node addresses splitted by comma: "-c node1,node2,node3".
You can learn more about drivers at ScyllaDB University: S210 Using Drivers