ExecutionProfile is a database-driver configuration object. It groups execution settings that shape how application queries return rows, choose cluster nodes, and handle other driver behaviors. section 10.7
Use an execution profile to configure practical application behavior:
- Set row_factory to dict_factory so driver-returned rows become dictionaries that Flask can serialize as JSON. section 10.2.3
- Pass the profile to Cluster through execution_profiles, making its settings active for database sessions. section 10.2.3
- Choose load balancing with TokenAwarePolicy and DCAwareRoundRobinPolicy, routing requests toward the owning shard while rotating among suitable replicas. section 10.5.2
Returning authors as JSON
A Flask application creates an ExecutionProfile with row_factory=dict_factory, passes it to a Cluster connected to ScyllaDB, and uses a session to execute SELECT * FROM authors. Iterating over the result set produces dictionary rows that the /authors endpoint returns as a JSON list.
