Sorry to resurrect and old post, but would love to hear core team comment on this ↑. I’m trying to come up with a list of best practices to follow in how I design my Dgraph schema and perhaps I’ve been conditioned through years of SQL hell to be nervous about n+1 queries and performance issues—but should I really just go ahead and create whatever schema I can think of with reckless abandon, or are there caveats?
Based on this ↑ it would seem that the best practices I should follow are:
- Worry less about size of database and more about how many edges your queries will need to traverse
- In order to ensure best possible query performance:
- Design your schema in such a way that the number of edges your queries need to traverse is minimised
- Rely on indexes (using @search directive?) of relevant predicates to get performance out of queries
- Generally it’s preferable to have more granular types if the existence of those types reduces the number edges a query needs to traverse …?
Am I missing anything?