graph-databasesboltmemgraphdb

Is there a difference between this configuration settings for Bolt on Memgraph?


When defining configuration settings for Bolt that will connect to localhost what is the preferred way?

Can I use any of these three methods?


Solution

  • The best would be to use 127.0.0.1. These three addresses can resolve to the same resource, but there are some situations when this will not happen.

    0.0.0.0 is all IPv4 addresses for devices on a machine, internally and externally facing so it's sometimes a security risk. 127.0.0.1 is IPv4 loopback. localhost resolves to either 127.0.0.1 (IPv4 loopback) or ::1 (IPv6 loopback). If you use 127.0.0.1 in one place, you can't necessarily expect localhost to resolve to the same address, because of potential ipv6 confusion.

    Best practices are to specify a specific, non-0.0.0.0 address and not localhost, due to the ipv6 confusion issue that can lead to connection failures.

    You can also find some additional details on Superuser site question "What's the difference between 127.0.0.1 and 0.0.0.0?"