It has come to this point. How to handle multi-tenancy.
- single-tenant - 1 instance per tenant (would get hairy once the number of tenants grows and we have data that should be shared between tenants, and which would need effort to keep in sync on all instances)
- Tenant Label - tedious and error prone
- Referenced Tenant node - perhaps a bit simpler to get head around but still tedious and error prone
From what I saw in other threads, there is already multi-tenancy on the roadmap, but it's probably still at least half a year away: Proper way to implement multi-tenancy on Neo4j
Another set of approaches is documented pretty nicely in this article: https://www.experoinc.com/post/multi-tenant-applications-in-neo4j
And i've also seen references that if we would have used the Java OGM, or with ruby with Neo4j.rb (http://blog.vivekprahlad.com/multitenancy-with-neojrb/) or with Gremlin instead of Cypher via PartitionStrategy (http://tinkerpop.apache.org/docs/3.1.0-incubating/#_partitionstrategy) we could have achieved multi-tenancy.
Well, too little too late for us now. We have 4 NodeJS api's that each communicate with Neo4j.
So, does anyone have a tip for us on how to approach this? Should we wait it out until Neo4j 4.0 is launched and until then deal with 1 db per tenant?
Is there any other "trick" we could use?
I was thinking even of something like, authentication with different credentials per tenant, and a Trigger or something in Neo4j that would filter results depending on the user making the call.
From what I understood, there is the possibility to enforce this via Subgraph access control (https://neo4j.com/docs/operations-manual/current/authentication-authorization/subgraph-access-control/)
Is it worth the hassle or is there a simpler, better way?