Repository navigation
docs: add 'Choosing a Protocol from Python' to the server guide, pin the PG wire {cypher} claim - #255
Merged
Merged
Conversation
…in the PG wire {cypher} claim (#253)
The bindings docs showed requests as the only way to reach a served database from Python. The new section ranks the routes for one-row calls (the Postgres wire with the {cypher} prefix, then a persistent HTTP connection, then the official arcadedb-driver and arcadedb-driver-grpc, then Bolt), says what to use for large results and bulk loads, links ArcadeDB's own "Python: choosing a protocol" page, and labels every number as laptop, relative, one client thread, loopback. A new test checks that a {cypher} statement with a bound parameter works over the wheel's Postgres wire.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ubz3m6QXHESerCkehC1qgi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #253
Round 2 of the repo-wide best-practice sweep, for the server docs. The bindings docs showed
requestsas the way to reach a served database from Python and said nothing about protocols or clients. ArcadeDB's own documentation now has a section, Python: choosing a protocol, and its Bolt page has a section on choosing a protocol for low latency (read through the documentation repository, read only). The new section agrees with both and adds what we measured.What changed.
docs/guide/server.mdgets "Choosing a Protocol from Python": the PostgreSQL wire with the{cypher}prefix is the fastest single-row route (psycopg placeholders%s, sent to the server as$1,$2), a persistent HTTP connection is next, the officialarcadedb-driver(HTTP, httpx) andarcadedb-driver-grpcare convenient but add client cost (about 3x a lean client on a one-row read), the Pythonneo4jBolt driver is slower than a lean HTTP client on one-row reads and much slower on large results, large results prefer HTTP, and bulk loads stay on HTTP. A table gives the ratios, labelled as one laptop, one client thread, loopback, ArcadeDB 26.10.1, relative to a persistenthttp.client. The section says that the wheel has no gRPC plugin, soarcadedb-driver-grpcreaches the official server distribution only, and it does not contradict upstream: where upstream measured gRPC streaming fastest on very large results with a batch size of 10,000 or more, it says so, and says our default-batch 10,000-row read was slower.docs/index.mdanddocs/api-access-methods.mdlink to it, anddocs/development/testing.mdlists the new test.New test.
test_postgres_wire_runs_cypher_with_a_bound_parameterintests/test_server_wire_protocols.pyruns a{cypher}statement with a bound parameter through psycopg against the wheel's own Postgres plugin and checks a hit and a miss. It is the one claim in the section the wheel can verify by itself; I also ran the persistent-HTTP, Bolt and PG snippets against a server from the 26.10.1 wheel before writing them.Where each number comes from. Our protocol measurements (12 interleaved repetitions per route, fresh client process per run, identical answers checked on every route): one-row SQL and Cypher reads and the 100-row reads for the PostgreSQL wire,
arcadedb-driver-grpc,arcadedb-driver,requests.Session; Bolt one-row 1.6x and 100-row 7.1x from our first protocol round; the 3.3x gRPC and the Bolt statements for 10,000-row results from the verification of the upstream Bolt batching change on a 26.11.1 pre-release build; 5 microseconds per record, 1,000 records per pull and the 4x to 10x range are quoted from the ArcadeDB maintainers' statements on the upstream issue; the 0.45x to 0.5x PG wire figure matches the ~0.5x in upstream's Bolt page.requestsshown as the Python clientdocs/index.md:76-85,docs/api-access-methods.md:108-166,docs/guide/server.md:240-306docs/index.mdafter the HTTP example anddocs/api-access-methods.mdbefore the token sectiondocs/guide/server.md:149-179docs/guide/server.md:224-229,docs/api-access-methods.md:317-319arcadedb-driver-grpcdocs/guide/server.md"Bulk Loading over the Server"CONTENT :rowsand/api/v1/batch, PG wire for vector rowsVerification. Full test suite on the 26.10.1 wheel built from this tree's source: 877 passed, 4 xfailed, 14 failed, and the 14 are exactly the known
test_count_pushdown_known_issues.pyfailures that pass on the 26.11.1 snapshot in CI.mkdocs build --strictclean (the new anchors resolve), pre-commit andblack,isortclean, bandit low/low oversrcandtestsclean.Not verified. Every number is from one laptop with E cores under shared load and has not been repeated on a second machine, which is why they are ratios and say so. The
fetch_sizeeffect on a 26.11.1 server was not re-measured here; on the 26.10.1 server a 10,000-row result did not get faster with it in three runs. The gRPC rows are JDK 25; the section says JDK 21 was slower (1.65x on a one-row read).🤖 Generated with Claude Code
https://claude.ai/code/session_01Ubz3m6QXHESerCkehC1qgi