Graph queries

Bolt protocol

Which Bolt versions and messages the server speaks, authentication, TLS and the clients it was checked with.

raftdb-bolt speaks the Bolt protocol of Neo4j, so the official drivers and tools connect without changes. By default it announces itself as RaftDB/<version> (Bolt 5.x compatible). The JavaScript, Go and .NET drivers read only the version from that name and work with it. The official Java and Python drivers refuse any server whose name does not start with Neo4j/ ("Server does not identify as a genuine Neo4j instance"), so they do not connect. The former option --identity vendor, which announced Neo4j/5.26.0 for them, was removed for legal reasons.

Versions#

Bolt 5.4, 5.3, 5.2, 5.1, 5.0 and 4.4. The server takes the first of the client's proposals that covers one of these. A client that offers none of them is refused.

Messages#

MessageMeaning
HELLO, LOGON, LOGOFFstart of a connection and authentication (from Bolt 5.1 the credentials travel in LOGON)
RUN, PULL, DISCARDrun a statement and fetch or drop its rows; PULL may ask for the rows in pieces
BEGIN, COMMIT, ROLLBACKexplicit transactions
RESETback to a clean state: rolls back, drops a pending result, clears a failure
ROUTEa routing table that names this server for reading, writing and routing, so that neo4j:// addresses work
TELEMETRY, GOODBYEaccepted

Errors are FAILURE messages with Neo4j status codes, for example Neo.ClientError.Statement.SyntaxError, Neo.ClientError.Statement.TypeError, Neo.ClientError.Statement.ArithmeticError, Neo.ClientError.Statement.ParameterMissing, Neo.ClientError.Schema.ConstraintValidationFailed, Neo.ClientError.Security.Unauthorized, Neo.ClientError.Security.Forbidden. After a failure the server ignores messages until RESET, as the protocol says.

Values#

Null, booleans, integers, floats, strings, lists and maps in both directions. Nodes, relationships and paths are returned as the Bolt structures (with element ids in Bolt 5). Dates, times (with named time zones), durations, points and byte arrays are supported in both directions.

Accounts#

raftdb-bolt --db graph.raftdb --user ann:SECRET --user reporting:OTHER:readonly

The scheme is basic (user name and password). Roles: readonly may run reading statements only; readwrite and admin may run everything. Passwords are stored as salted PBKDF2-HMAC-SHA-256 hashes. Without any --user, nobody has to log in: use that on a trusted machine only.

TLS#

With --tls-cert and --tls-key (or --tls-auto) the server accepts TLS on the same port as plain Bolt:

AddressMeaning
bolt://host:7687no encryption
bolt+s://host:7687TLS, certificate checked against the system's authorities
bolt+ssc://host:7687TLS, a self-signed certificate is accepted (--tls-auto)
neo4j://, neo4j+s://, neo4j+ssc://the same with a routing table (always this one server)

Checked with#

ClientWhat was run
cypher-shell 5.26queries, nodes, relationships and paths in its output, :begin / :rollback, :param, EXPLAIN, errors
Neo4j Java driver 5.28the benchmark workloads with 1 to 16 sessions
Neo4j Python driver 5.28the 399 statements of the test corpus: the same answers and error codes as in-process

The JavaScript, Go and .NET drivers (5.28.1) were run against the server and pass the same 18 checks: parameters of every type, nodes, relationships and paths, dates and times with named time zones, transactions and errors.