Does a CQL query become token-aware depending on its size?

Please provide some background information on how it works.

In ScyllaDB (and other distributed databases like Cassandra), each node contains only a part of the data. Ideally, a query would reach the node that holds the data (one of the replicas). If this doesn’t happen, the coordinator node (the node that is responsible for communicating with the client for that specific query), will need to send the query internally to a replica, resulting in an extra hop and, thus, higher latency and more resource usage.

The size of the query does not cause it to become token-aware (nor does it have any effect on token awareness). Non token aware Queries are queries that did not reach a replica-node, most likely due to not using prepared statements, or not using token aware drivers. Load balancing can also have an effect on token awareness.

To test this, you can analyze internal flows within a cluster using Tracing. Also, using ScyllaDB Monitoring you can see if your application is using queries that are not token-aware.

Another related concept is Shard Awareness, and the Shard Aware Port which provides an additional performance improvement.

1 Like