Does DGraph support multiple databases?

I want to have multiple isolated schemas for querying against, just as you would have separate databases in an RDBMS that you can choose to query in a client call. Is this supported?

The way you wanna, no. It’s not supported.

(opinion below)

You can format a model in your application by pointing to each instance group (Dgraph set) individually.

It’s going to take more work (I believe). You need to configure unique PORTs and other configs for each instance group. But it is perfectly possible that way.

It is not encouraged, Cuz the characteristics of the Dgraph provide any need for that. Dgraph can split work between multiple instances. Create Shards and etc. There would be no need for RDBMS, technically speaking. But it is possible.

Also there is another way you can do by creating a gateway (application) in GraphQL pointing to those clients. It would be the same work of the previous, but it would be more organized and you would have the advantage of using GraphQL.

2 Likes

Thanks for the reply!

Just to be clear, I don’t need physical separation, just logical. For example I may reuse a node type for different customers’ datasets and want to filter nodes for a query without having to namespace every node or relation with customer_a_. In a regular SQL database I would create separate tables (or separate databases) to isolate customers’ data.

Are you saying the only way to do that is have separate physical installations of DGraph with some routing logic (gateway) to route to different DGraph servers?

The Gateway example is a physical separation. There is no logical separation in Dgraph. Some ideas about this has already been discussed here in the forum, but the real use and need of it has not yet been decided.

Exactly. Graph databases were designed to eliminate the use of tables as in SQL. So it would not make much sense to return to this logic, you know? Graph DB’s are another paradigm.

@Jonathan,

If I understand correctly you want to create multiple, disconnected graphs within a single Dgraph instance, right?
I have actually wondered about that possibility myself as separation of data by client (as in people who pay you, not DB access devices/drivers) is a very common concern and keeping multiple instances around adds to resource consumption and logistical overhead.

1 Like

Yes @hamoser that is correct

Hi,

It’s not possible other than the suggestion of multiple servers.

This has been kicked around a few times; e.g. here and here. Doesn’t seem to be on the current timeline, but was has also been mooted as a possible commercial multi-tenancy feature.

Would be cool.

that’s not supported and i need to deploy more dgraph clusters for different usage

Another use case is isolating schemas for multiple microservices sharing the same dgraph runtime. That’s an increasingly common usage pattern many databases support.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.