Facets: Not First-Class Citizens?

I came across this line about Facets in the Dgraph docs that stood out to me:

Facets are however not first class citizen in Dgraph like predicates.

Can someone elaborate on this? What makes them not first-class citizens like predicates? What are the tradeoffs in using them?

I understand that they shouldn’t be used in the same way you’d use an edge - especially after reading the example provided, but even if used properly, the wording in the docs makes me feel that there’s some kind of downside in using them. Any clarity here would be appreciated.

So facets are not first class citizens because they are stored directly with the data for the predicate that they belong to instead of being stored in its own entity. Dgraph scales by sharding your data by predicates and storing it on separate machines. If you had a large amount of facets for a predicate which were taking up a lot of space, they can’t be sharded and stored on different machines.

Also, because of the way facets are stored, sorting and filtering using facets doesn’t make use of any indexes and won’t perform as well as that by predicates. Facets might be good for you if your use case mostly requires writing and reading them.

Got it. Thanks for the detail.