Hello, I’m using dgraph for my new project, but coming from a RDBMS background I have the following doubts regarding predicates, and I want to be clear before starting to write code:
-
Does dgraph performance it’s better with more predicates? for example if we have a node for USERS and a node for CITIES and both of them have a NAME predicate it’s better to leave it as NAME or it would be better to make a USER_NAME and CITY_NAME predicates distinct for each node?
-
I’m making a multitenant app, so for security each node should have some reference to the tenant, so I have thinked of three possibilities, but Im not sure what would be the most performance-wise:
- Each node have an edge connecting to the tenant node.
- Each node have a predicate named after the tenant id (eg: t-xxid="")
- Each node have a predicate called tenantId with the value of the tenant id(eg: tenandId = xxxid) -
Does predicates are indexed??
-
Finallly and not regarding predicates… when we use a HA replicas, the writes can be to any server or only to the master??