Causal Reads
This page is part of MariaDB's Documentation.
The parent of this page is: Use Cases
Topics on this page:
Overview
Causal reads guarantee that read-only queries on replica servers still return the most current data, even if the replica server is lagging behind the primary server.
In some multi-node deployments, causal reads are always available. For example, MariaDB Xpand replicates data in a strongly consistent manner, so all queries on all nodes will return the most current data.
In some other multi-node deployments, read-only queries executed on replica servers can return stale data due to replication lag if the queries are not executed in a causally consistent manner. Causal consistency is the act of ensuring that interdependent operations maintain consistency by performing them in the same order on all servers. When causal consistency is applied to read-only operations, the operation is typically called a "causal read."
MariaDB database products have many different ways to implement causal reads, depending on the specific components and technologies involved:
Multi-Node Implementation | MaxScale Component | Enabling Causal Reads |
---|---|---|
Any | MaxScale's Consistent Critical Read Filter (ccrfilter) can be used to enable causal reads when it is used in tandem with MaxScale's Hint Filter (hintfilter), and any of MaxScale's routers that supports routing hints, like Read/Write Split Router (readwritesplit) and Hint Router (hintrouter). |