Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?
like image 705
Naresh Joshi Avatar asked Oct 26 '25 23:10

Naresh Joshi


1 Answers

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

like image 89
Luanne Avatar answered Oct 29 '25 13:10

Luanne