Need Help Installing Neo4j Package in AWS Lambda for Project

Hi everyone,

I'm currently working on a project that will be hosted on AWS Lambda, and I need to connect to a Neo4j database to fetch some information. I've been trying to install the Neo4j package in Lambda by creating a virtual environment, zipping it, and adding it as a layer, but it doesn't seem to be working.

Could someone please guide me through the steps, providing a detailed, step-by-step process to properly install the Neo4j package in AWS Lambda? I specifically need to initialize the session successfully and fetch the necessary data from the Neo4j database.

Any help or advice would be greatly appreciated! Thank you in advance.

Hi @ivona.feit, did you figure out how to deploy Neo4j as an AWS serverless deployment running as an AWS Lambda function?

A database can’t be “serverless” - the concept of serverless implies there is no storage or central CPU.

Databases rely on shared storage, shared memory and shared CPU (in a server or a cluster).

A lambda is an ephemeral function - you need 2 tiers (one for the lambda, one for Neo4J)

@joshcornejo, thanks a lot for your answer.

Please be aware that “serverless” and “stateless” are different. Neo4j does run as a Docker container (serverless), and when it does, it needs a volume to preserve the state.

My question concerns a similar setup, but using AWS Lambda (a single node) instead of a Kubernetes cluster.

Hi Marco,

  • Stateless is related to the functions or API logic (“they don’t hold state, any function implementation can serve any request”)

  • Serverless is related to the abstraction of the infrastructure (“there is no dependency on a specific server to run a request”)

  • Docker is a container virtualisation (“the server running doesn’t know the hardware is running on”)

  • Neo4J running inside docker is on a linux container:

And in AWS:

  • Lambda is to run code
  • EC2 (of different flavours) is to provision services (like Neo4J)