Cleanest way to make an ORM for neo4j + sql in python flask? One model over 2 databases Cleanest way to make an ORM for neo4j + sql in python flask? One model over 2 databases flask flask

Cleanest way to make an ORM for neo4j + sql in python flask? One model over 2 databases


I've recently released an OGM (Object-Graph Mapping) module for py2neo (http://book.py2neo.org/en/latest/ogm.html). This might help with what you're trying to do.

Otherwise, you could also look at neomodel (https://github.com/robinedwards/neomodel). It's written for Django but should be usable in Flask too.


I don't know about mixed backend models, but I think depending on your user count, you can use neo4j for your users, too. If you put the user nodes into an index, you can get all users without searching the graph.

If you find that this actually is a bottleneck, migrating it to a split storage should not be too difficult.


It is not that hard to adapt neo4j-driver and py2neo to use eg. Flask-Login.I have use py2neo to that and worked well, but migrated now to neo4j-driverDownside is that i did not manage to get it working with eg SQLalchemy etc.Using a double backend solution is not a problem, in an earlier project i have used SQLalchemy with SQLite3 and PostgreSQL, Neo4j and redis together.Using that, i have found no issues other than some design issues.