Is there a way to control how the predicates are sharded between alphas?


#1

I know the majority of the queries made to the graph will contain specific groups of predicates. Is there a way to force specific predicates to be on the same alpha node to reduce the number of network calls to speed up those queries without replicating the data to all nodes?

For example right now lets say I have 3 alphas and 7 predicates
A1 - P1, P2, P3
A2 - P4
A3 - P5, P6, P7

and I know most of my queries will contain P1 and P7 together, and lets say P3 and P5 together
Is there a way to configure it so that it’s stored like…
A1 - P1, P2, P7
A2 - P4
A3 - P5, P6, P3


(Michel Conrado) #2

You can move tablets with:

/moveTablet?tablet=name&group=2
This endpoint can be used to move a tablet to a group. Zero already does shard rebalancing every 8 mins, this endpoint can be used to force move a tablet.

https://docs.dgraph.io/deploy/#more-about-dgraph-zero


#3

:+1: Thank you, that route works for me. However, I noticed the predicate move times out sometimes (it seems like there is 9G+ of data to shuffle) and I get something about the context deadline exceeded. Is there a way to configure the predicate move timeout to be longer than 20 mins?

Also, is there a way to configure the bulk loader to force some predicates to be together so there isn’t a need to reshuffle?

Lastly, is there a way to only replicate some predicates and not others? Like some predicates I’d like 2-3 copies for better read performance, while other predicates that will be rarely used, with just one copy?