liveBook · Manning

ExecutionProfile

As explained in ScyllaDB in Action

ExecutionProfile is a database-driver configuration object that controls request execution settings such as retry, row handling, and load-balancing policies.

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.

How ScyllaDB in Action covers it

How deep it goes
Explains construction, registration, row factories, and load-balancing policies, while only noting retries and other behaviors without detailing their implementation.
Examples
Demonstrates dictionary rows in an /authors endpoint and combines TokenAwarePolicy with DCAwareRoundRobinPolicy.
What it assumes
Assumes familiarity with Python imports, Flask endpoints, Cluster connections, sessions, and basic ScyllaDB queries.
What you can do after
Operate/configure a Python ScyllaDB driver with dictionary rows and explicit load-balancing behavior.
How it connects
Connects database drivers with Flask, Cluster objects, sessions, row factories, load balancing, token-aware routing, and round-robin routing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ScyllaDB in Action. The section links point to the parts of the book it draws on.