I am developing graph database using neo4j and Spring Data Neo4j (SDN) at the backend. And SDN allows me to connect to neo4j by using either HTTP or BOLT and SDN also provides all the configurations I just need to mentioned include properties and dependencies
#Replace http with bolt
spring:
data:
neo4j:
uri: http://localhost:7474
username: neo4j
password: nopassword
However, while using HTTP I don't need to include any other dependency in the just spring-boot-starter-data-neo4j works fine
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-neo4j</artifactId>
</dependency>
But for using BOLT I need to include one extra dependency
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-neo4j</artifactId>
<exclusions>
<exclusion>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-http-driver</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>4.2.2.BUILD-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-bolt-driver</artifactId>
<version>2.1.2</version>
</dependency>
So let me break out my question in smaller questions
Bolt is a binary protocol, more compact, with higher throughput than HTTP. The only reason you might consider using HTTP with the current version of SDN is if you use the HA setup fronted by HAProxy. Otherwise, Bolt should be your default choice.
For more on bolt: https://neo4j.com/blog/neo4j-3-0-language-drivers/ https://dzone.com/articles/introducing-bolt-neo4js-upcoming-binary-protocol-p
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With