liveBook · Manning

Constant speculative execution policy

As explained in ScyllaDB in Action

ConstantSpeculativeExecutionPolicy is a driver policy that retries a request at a fixed interval up to a configured number of reattempts.

ConstantSpeculativeExecutionPolicy retries a query after a fixed delay, up to a configured number of reattempts. The driver returns whichever request finishes first, reducing the impact of a slow request. section 10.5.3

Configure the policy by choosing:

  • A retry interval: the time Scylla waits before starting another request. section 10.5.3
  • A maximum number of reattempts: the limit on speculative requests. section 10.5.3
  • An execution profile: the policy is attached there alongside load-balancing configuration. section 10.5.3

Reviews application configuration

A small reviews application uses a 0.1-second interval and two maximum speculative attempts. It applies the policy to idempotent queries such as retrieving authors and articles. Aggressive settings can create unnecessary duplicate work, so the retry interval should be chosen from query performance data; the 99.9th-percentile latency is suggested as a starting point. section 10.5.3

How ScyllaDB in Action covers it

How deep it goes
Defines interval and attempt limits, demonstrates execution-profile configuration, and warns about duplicate work.
Examples
Uses a reviews application, 100-millisecond intervals, two attempts, and author or article retrieval queries.
What you can do after
Operate/configure the ScyllaDB Python driver with bounded speculative retries for idempotent queries.
How it connects
Connects speculative execution with execution profiles, load balancing, idempotent queries, and query performance metrics.

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.