How to run separate sets of data

I know, I know, I’m suffering under the weight of years of working with relational databases.

I’m working on two separate projects - a system for an English language school and a different one just for myself. If I want to run both projects on dgraph, how would I go about doing that? In mysql I’d just create a new database and neither database would need to know about the other one. With dgraph I’m a bit baffled.

Is it done by running a different dgraph alpha? I’ve just tried creating a new one, which has created new p and w directories in a new location, but how do I access that new one in dgraph-ratel, for example? Is that even the right way to do it? Would I need to run a new dgraph alpha (thereby using more ports) with each new “database”?

I have a feeling this kind of question has been asked before but the answers confuse me. The most relevant is this one, I think, but I’m too much of a noob to know what to do:

1 Like

Yes, new Dgraph Alpha. With a diff port offset. (multiple servers)

This will depend on the way you set up your set. If you are using Docker, K8s, Local Binaries. They are different ways of dealing.

Ratel accesses the Dgraph via HTTP. That is, each Alpha has to be accessible.

For example, if using local binaries, the use of different --port_offset is mandatory for this. If you are using docker the offset may also be necessary, but if you are using reverse proxy it would be different (depending on which http reverse proxy you are using) you would have a path for each Alpha if that were the case.

So, this will depend on the technology you are using in context. But overall, you should point the Ratel to the correct addr with its respective --port_offset.

However, you can try to create an imaginary division within a Dgraph structure. Creating a tree, and relating the data to this tree (and branches). But you would have to deal with that structure by yourself doing some logic by code.


1 Like

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