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
- Why should we use the bolt instead of HTTP?
- How is it different than HTTP?
- What advantages or disadvantages it have over HTTP?
- And should I go with it or just HTTP is fine?