What advantage bolt gives over http and Why should we prefer bolt,

Viewed 3096

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

  1. Why should we use the bolt instead of HTTP?
  2. How is it different than HTTP?
  3. What advantages or disadvantages it have over HTTP?
  4. And should I go with it or just HTTP is fine?
1 Answers
Related