Tech Stack & deployment for Python-Neo4j Backend in production

Hi,

I am looking to create a backend service using python and neo4j. I have set something up locally using the python bolt driver, but im looking to move this into production. I know this question is abit general, but I was wondering if anyone has built & deployed a production level python webserver using neo4j. My main considerations are:

  • where are you hosting the DB?
  • hosting service for server? (aws-lambda, heroku, elasticbeanstalk)
  • web framework? django, flask etc
  • db driver? neobolt driver vs py2neo
  • CI/CD, build process and unit testing

Interested to hear your suggestions!

Hi,

We're also developing web applications using python and are about to move to production.

For hosting we do it ourselves, We're a solution provider and are also offering this solution to anyone interested. If you want more info just send me a DM.

For hosting we just use uwsgi inside a docker container. We run everything in containers for scalability.

Web framework for us is currently Flask, Django is also a great option. But if you don't need the extras Django provides have a look at starlette and Sanic. 2 great frameworks similar to Flask but with higher performance. We'll be moving over our codebase to one of those two when we decided which one fits best.

For database connections we use Neomodel (OGM) which is based on neobolt. I have experience with py2neo and it works great. The Neomodel OGM is better in my opinion than the py2neo OGM but it works great if you want to directly query using cypher.

For CI/CD we run our own docker scripts on our hosts. this allows for testing as it would be the same setup as production. We use pytest for unit testing. and the deployment of everything is ran in bitbucket (cloud).

We are extremely satisfied with our setup. If you'd like more in depth info just hook me up with a message and questions you might have.

2 Likes

Hi! how are you?
Read about your job bring me good news to continue the integration with django.
I started to do it but im stuck at an error related with

NodeMeta' object is not iterable

Although im using neomodel I think I have to develop some adapter but Im not sure how to continue after this. Are you using neo4j-django or another library for this?

Thank you so much :)

I have personally not used Django but i know there are several people using it. Neo4j-Django should work for this. Also have a look at https://neo4django.readthedocs.io/. This might also help you

Thank you for your answer! Im afraid that both of the libraries I found to adapt to djang are like outdated or without support.

GitHub - scholrly/neo4django: Drop-in Neo4j/Django integration. this is the repo from the library u recommended, and the last update if from 7 years ago :frowning:

Also, this library GitHub - neo4j-contrib/django-neomodel: Neomodel plugin for Django to use with neomodel seems to be in a similar situation..the last update is from 3 years ago.

My dubt is about to use a library without current support for production.

django-neomodel should still work as it's only an adapter. So if Django doesn't change the way of calling models and neomodel doesn't change its code it shouldn't be a problem