Neo4j and Multi-tenantcy

799 views
Skip to first unread message

Caleb Jones

unread,
Feb 9, 2012, 4:58:20 PM2/9/12
to Neo4j
I'm still a bit new to the ins and outs to Neo4j, but I wanted to ask
here about a use case around multi-tenancy.

What I'm looking to build a single Neo4j cluster which can handle
multi-tenancy. The basic multi-tenancy requirement is simply that
tenants have their own logically separated graph space that they can
play with.

The analogy, say, with a RDBMS is that you can create a database per
tenant and let them use it how they want.

Is there a similar entity in Neo4j that would provide this kind of
logical isolation?

James Thornton

unread,
Feb 9, 2012, 5:04:11 PM2/9/12
to ne...@googlegroups.com
TinkerPop's Rexster (https://github.com/tinkerpop/rexster/wiki/) supports hosting multiple Neo4j databases from one server.

- James

Peter Neubauer

unread,
Feb 10, 2012, 3:57:49 AM2/10/12
to ne...@googlegroups.com
Caleb,
are you looking at firing up a whole new graph and JVM for each
tenant, or having subgraphs that are not reachable from different
users, thus reusing (and possibly competing for JVM resources)
between the tenants?

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Neo4j 1.6 released                 - dzone.com/6S4K
The Neo4j Heroku Challenge   - http://neo4j-challenge.herokuapp.com/

wni

unread,
Feb 10, 2012, 5:22:47 AM2/10/12
to Neo4j
Hello Caleb,

I'm not shure understood all what you want.
I could offer you our approach: after unleashing of the IndexProvider
we could give prefixed names for every tenant for the indices. The
tenant is always available as GrantedAuthority.

It's a very smart solution (we think so) :)

Best wishes
Werner

Vivek Prahlad

unread,
Feb 10, 2012, 5:43:54 AM2/10/12
to ne...@googlegroups.com
Caleb,

We've done some work around Multitenancy with Neo4j.rb, you can read about the approach here: http://blog.vivekprahlad.com/multitenancy-with-neo4jrb
This solution doesn't use a multi-database approach, though - it partitions a single graph database to support multiple tenants. Both traversals and lucene searches are partitioned on a per tenant basis.

Cheers,
Vivek

James Thornton

unread,
Feb 10, 2012, 7:08:06 AM2/10/12
to ne...@googlegroups.com


On Friday, February 10, 2012 4:43:54 AM UTC-6, Vivek Prahlad wrote:
We've done some work around Multitenancy with Neo4j.rb, you can read about the approach here: http://blog.vivekprahlad.com/multitenancy-with-neo4jrb
This solution doesn't use a multi-database approach, though - it partitions a single graph database to support multiple tenants. 


- James

Caleb Jones

unread,
Feb 10, 2012, 9:31:00 AM2/10/12
to Neo4j
@Peter

> are you looking at firing up a whole new graph and JVM for each>
> tenant, or having subgraphs that are not reachable from different
> users, thus reusing (and possibly competing for JVM resources)
> between the tenants?

The latter. This is a shared multi-tenancy environment.

@wni

> after unleashing of the IndexProvider
> we could give prefixed names for every tenant for the indices. The
> tenant is always available as GrantedAuthority.

That's interesting. I'll have to look into that.

@James
Thanks. I'll have to take a look at that.

@Vivek

> it partitions a single graph database to support multiple tenants. Both traversals and
> lucene searches are partitioned on a per tenant basis."http://blog.vivekprahlad.com/multitenancy-with-neo4jrb"

That seems to meet the requirements I'm going after. I'll have to read
up on your link (http://blog.vivekprahlad.com/multitenancy-with-
neo4jrb).


Here's my followup question. Do any of the above suggestions *prevent*
segmented graphs from being able to start linking to each other? There
could be great power in different tenants being able to link to each
other and start leveraging eachother's data. Does Neo4j provide any
ACLs around this? I'm thinking the most likely use case is tenants
agreeing to allow other tenants to read their graphs but *not* write.

Peter Neubauer

unread,
Feb 10, 2012, 9:38:02 AM2/10/12
to ne...@googlegroups.com

Would something like http://docs.neo4j.org/chunked/snapshot/examples-acl-structures-in-graphs.html fot the bill?

Send from a device with crappy keyboard and autocorrection.

/peter

James Thornton

unread,
Feb 10, 2012, 9:46:05 AM2/10/12
to ne...@googlegroups.com


On Friday, February 10, 2012 8:31:00 AM UTC-6, Caleb Jones wrote:

Here's my followup question. Do any of the above suggestions *prevent*
segmented graphs from being able to start linking to each other? There
could be great power in different tenants being able to link to each
other and start leveraging eachother's data. Does Neo4j provide any
ACLs around this? I'm thinking the most likely use case is tenants
agreeing to allow other tenants to read their graphs but *not* write. 

Look at Tinkerpops' Blueprints Sail Ouplementation (https://github.com/tinkerpop/blueprints/wiki/Sail-Ouplementation) and unified graph views with MultiGraph (https://groups.google.com/d/msg/gremlin-users/NffLoF4tikI/y2esP6vK9gMJ).

- James 

Reply all
Reply to author
Forward
0 new messages