DEV Community

Cover image for Mastering Neo4j: Graph Database Awesomeness Unleashed!
Ahmed Zidan for AWS Community Builders

Posted on • Edited on • Originally published at dailytask.co

Mastering Neo4j: Graph Database Awesomeness Unleashed!

Dive into the world of Neo4j, where nodes, edges, and attributes come together in a symphony of data excellence. 🎓✨

Deploying Neo4j with Helm

Unlock the power of graph-data-science with a breeze! Follow these steps:

  1. Prepare Your Helm Chart:
  • Create a values.yaml file with essential configurations.
neo4j:
  name: licenses
  acceptLicenseAgreement: "yes"
  edition: enterprise
  resources:
    cpu: "1000m"
    memory: "2Gi"
volumes:
  data:
    mode: defaultStorageClass
env:
  NEO4J_PLUGINS: '["graph-data-science"]'
config:
  dbms.security.procedures.unrestricted: "gds.*"
Enter fullscreen mode Exit fullscreen mode
- Example Helm Chart available [here](https://github.com/neo4j/helm-charts)
Enter fullscreen mode Exit fullscreen mode
  1. Deploy with Helm:
  • Execute a single command for deployment.
helm repo add neo4j https://helm.neo4j.com/neo4j
helm repo update
helm upgrade --install neo4j-cluster neo4j/neo4j --namespace neo4j --values values.yaml --version v5.15.0
Enter fullscreen mode Exit fullscreen mode
  1. Verification:
    • Confirm your installation with kubectl get pod.
~ kubectl get pod 
NAME              READY   STATUS    RESTARTS      AGE
neo4j-cluster-0   1/1     Running   0                           124m
Enter fullscreen mode Exit fullscreen mode
  1. Graph-Data-Science Check:
  • Verify graph-data-science with a Neo4j console query.
RETURN gds.version();
Enter fullscreen mode Exit fullscreen mode

gds.version command line

Importing Data to Neo4j Cluster

Simplify the database import process effortlessly:

  1. Upload Dump File:
  • Move your dump file to the pod.
kubectl cp Downloads/neo4j.dump neo4j/neo4j-cluster-0:/import/neo4j.dump 
Enter fullscreen mode Exit fullscreen mode
  1. Run Import Command:
  • Execute the import command line.
kubectl exec neo4j-cluster-0 -- neo4j-admin database load --from-path=/import neo4j --overwrite-destination=true --verbose
Enter fullscreen mode Exit fullscreen mode

⚠️ Issue Resolution:

  • Encounter locking issues? Delete the lock file.

Caused by: org.neo4j.io.locker.FileLockException: Lock file has been locked by another process: /data/databases/neo4j/database lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)

kubectl exec neo4j-cluster-0 -- rm -rf /data/databases/neo4j/database_lock 
Enter fullscreen mode Exit fullscreen mode
  1. Restart Neo4j:
  • Ensure data loading completion.
kubectl exec neo4j-cluster-0 -- neo4j restart
Enter fullscreen mode Exit fullscreen mode

Ready to unravel the magic of graph databases? 🌐✨ Connect with me on:

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post