I have many questions

1.What is the difference between graphql and dql?
2.What are the advantages of HA clusters? If I have three servers, how can I better configure an HA cluster with 16G + 8 cores + 16 threads + 1 Thdd? Configure three zero nodes and six alpha nodes?
3.If I want to set the schema in advance, how should the attributes of the edges be defined, and how the labels are used?Can you provide a detailed demo。

DQL is the native language of Dgraph and GraphQL is the API language supported by Dgraph. And both are very similar, with similar performance. The GraphQL is really nice for front-end devs and DQL is powerful for other DB mining.

I think the general meaning of High availability should fit. @dmai could add more about it and the configs.

Not sure what you mean. You should always define your schema in advance. Edges, do you mean relations? not clear what you mean. Values and relations should be straightforward. We don’t use the concept of labels. Predicate/edges can work like “Labels” but we don’t use that concept. Also, “dgraph.type” can be a similar concept of “Labels”.

1 Like

Hi @shuai
Regarding high availability: One example of a high-available set up is a 6-node Dgraph cluster (3 Zeros, 3 Alpha replicas). You need to set --replicas=3. In this case, if one of the alpha goes down, quorum is still maintained and transactions will still run. See this for more details.

cc @dmai

Thank you for your help. I have other questions. How to distribute these six alpha nodes, for example: 10.10.10.10: 7080, 10.10.10.10: 7081, 10.10.10.10: 7082 is a set of alphas, deployed on the same device, And point to the zero node of the local machine, the other two also do the same, or a set of alpha should be distributed on different machines? In addition, I use the config file to configure alpha and start it. Do I need to configure three config files? Can you provide me with a demo? The official only provides docker deployment, and hopes to provide configuration instructions for binary file deployment.

The point of having more alphas is for HA horizontally. This is to reduce the points of failure. If 3 alphas are on the same physical machine the points of failure still go to a single machine. Maybe someone else can give more feedback from a lower level understanding, but I don’t know if there are actually any benefits of running multiple alphas of the same db on a single machine.

I could see running multiple instances of alphas on a single machine if they were for different graphs and there were other physical machines for the other alphas

Hi @shuai

  • I don’t believe there are any benefits to running multiple alphas per machine. Zero is responsible for distributing load across each alpha, and one alpha per machine should ideally be sufficient.
    Quoting from the doc:
    “Do not run multiple Dgraph Zeros or Dgraph Alpha processes on a single machine. This can affect performance due to shared resources and reduce high availability in the event of machine failures.”

  • One config files per alpha/zero is required. You can find more documentation here.

Could you please review the documentation here? There are some details about how to setup a 6 node cluster, and the flags for alpha and zero are documented.

2 Likes