neo4j
Understanding relationships ..
neo4j
Neo4j is a leading graph database management system designed to store, manage, and query highly connected data.
Unlike traditional relational databases that organize data in tables, Neo4j structures data as a graph of nodes, relationships, and properties.
Neo4j stores data in a property graph model where relationships are first-class citizens.
This approach makes traversing connections between data points extremely efficient - a significant advantage over relational databases that require expensive join operations.
Cypher Query Language
Neo4j uses Cypher, a declarative query language specifically designed for working with graph data.
Cypher syntax is visually intuitive, using ASCII art to represent patterns:
MATCH (person:Person)-[:LIVES_IN]->(city:City {name: "London"})
RETURN person.name

x
x
Create the Neo4j directories.
cd
mkdir -p Neo4j/neo4j_db/{data,logs,import,plugins}
Create a
docker-compose.yml
file.
cd
cd Neo4j
nano docker-compose.yml
services:
neo4j:
container_name: neo4j
image: neo4j:latest
ports:
- 7474:7474
- 7687:7687
environment:
- NEO4J_AUTH=neo4j/${NEO4J_PASSWORD}
- NEO4J_apoc_export_file_enabled=true
- NEO4J_apoc_import_file_enabled=true
- NEO4J_apoc_import_file_use__neo4j__config=true
- NEO4J_PLUGINS=["apoc", "graph-data-science"]
volumes:
- ./neo4j_db/data:/data
- ./neo4j_db/logs:/logs
- ./neo4j_db/import:/var/lib/neo4j/import
- ./neo4j_db/plugins:/plugins
Create a file called
docker-compose.override.yml
.
services:
neo4j:
environment:
- NEO4J_server_memory_heap_initial__size=6G
- NEO4J_server_memory_heap_max__size=6G
Again, you can create a
.env.example
and gitignoring.env
cd
cd Neo4j
nano .env
NEO4J_PASSWORD=<your password>
Onnce everything is in place.
cd
cd Neo4j
docker-compose up -d

Log into Neo4j:
Username: neo4j
Password: password


x
x
x
Last updated