From e037ab14bb27ae325caa80afc0321c8136e8d360 Mon Sep 17 00:00:00 2001 From: David Oliver Date: Mon, 31 Jan 2022 11:37:07 +0000 Subject: [PATCH 1/2] Add section on cluster routing capability --- modules/ROOT/pages/actions/index.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/actions/index.adoc b/modules/ROOT/pages/actions/index.adoc index 24cf4b5..b39a657 100644 --- a/modules/ROOT/pages/actions/index.adoc +++ b/modules/ROOT/pages/actions/index.adoc @@ -10,6 +10,7 @@ There are several _actions_ that can be performed using the Cypher transaction H * xref:actions/transaction-flow.adoc[] * xref:actions/query-format.adoc[] * xref:actions/result-format.adoc[] +* xref:actions/routing.adoc[] *Using the API:* @@ -31,4 +32,3 @@ There are several _actions_ that can be performed using the Cypher transaction H * xref:actions/expired-transactions.adoc[] * xref:actions/handling-errors.adoc[] * xref:actions/handling-errors-in-an-open-transaction.adoc[] - From 6787b86c4f4efe4b7d9597887e0c9b81298cbc16 Mon Sep 17 00:00:00 2001 From: David Oliver Date: Mon, 31 Jan 2022 11:37:38 +0000 Subject: [PATCH 2/2] Add routing page --- modules/ROOT/pages/actions/routing.adoc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 modules/ROOT/pages/actions/routing.adoc diff --git a/modules/ROOT/pages/actions/routing.adoc b/modules/ROOT/pages/actions/routing.adoc new file mode 100644 index 0000000..1201236 --- /dev/null +++ b/modules/ROOT/pages/actions/routing.adoc @@ -0,0 +1,25 @@ +:description: HTTP API routing. + +[[http-api-actions-cluster-routing]] += Clusters and routing + +The Cypher Transactional API provides a limited level of support for query routing. + +The level of support depends on whether link:https://neo4j.com/docs/operations-manual/current/clustering/internals/#clustering-routing[Server-side routing] has been enabled: + +[options="header", cols="20m,80a"] +|=== +| Server-side routing +| Support + +|disabled +|Clusters support read-only queries. + +|enabled +|Clusters support routing for queries that involve a xref::/actions/begin-and-commit-a-transaction-in-one-request.adoc[single request] (i.e. via the `tx/commit` endpoint). +This is because the cluster does not currently support transaction identifiers across the cluster. + +In this context, all queries are considered `WRITE` queries, even if they contain no cypher with write operations. +Since the HTTP API did not previously support marking queries as `READ` or `WRITE`, the server assumes all queries are `WRITE` queries to support all cases. +The effect of this is that all queries are ultimately executed on the leader. +|===