Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partitioning parent-child documents by parent id to avoid full replication of parent documents #32608

Open
vslaykovsky opened this issue Oct 17, 2024 · 4 comments
Milestone

Comments

@vslaykovsky
Copy link

Is your feature request related to a problem? Please describe.
I have many documents (200M+) with complex hierarchical structure. It cannot be expressed with nested structures like array due to limitations of indexing support. Also it doesn't make sense to search using all fields of these structures. So natural way to decouple would be to use parent-child relationship. Unfortunately, parent documents are always copied globally which means huge overhead on content nodes.

Describe the solution you'd like
Some way of describing sharding logic where parent IDs are used as keys. This lets us not copy all parent documents to all content nodes.

Describe alternatives you've considered
Considered all alternatives available today, each of them has certain limitations:

  • nested structures
  • parent-child with fewer beafy content nodes to reduce storage overhead
  • full denormalisation.
@kkraune
Copy link
Member

kkraune commented Oct 18, 2024

Hi, and thanks for the feature request!

Yes, the copy-parent-to-all-nodes feature potentially requires much memory, particularly in clusters with many nodes.

What you are describing is a kind of distributed join feature. https://github.com/vespa-engine/sample-apps/tree/master/examples/joins can be relevant as a way to solve problems where the parent/child feature cannot be used

For reference for others: https://docs.vespa.ai/en/parent-child.html

@kkraune kkraune removed their assignment Oct 18, 2024
@bratseth
Copy link
Member

This has been considered before and does make sense. We need to use some variant of document id's with groups and distribute the same groups to the same nodes across those document types. I think the main issue with it is that we'll easily end up with badly balanced clusters.

@vslaykovsky
Copy link
Author

This has been considered before and does make sense. We need to use some variant of document id's with groups and distribute the same groups to the same nodes across those document types. I think the main issue with it is that we'll easily end up with badly balanced clusters.

Can be done in theory with consistent hashing. Zookeeper is already used in vespa anyway.
Alternatively this concern can be shifted to the user. E.g. "you've been warned, this grouping is supposed to be used with well balanced data"

@bratseth
Copy link
Member

Yes, we do use something similar to consistent hashing in Vespa (the CRUSH algorithm), but here we need to distribute each group to a limited set of nodes to avoid needing to place all global documents on all nodes, while we have no control over the size of each group. I'm not sure how well this can be solved but it for sure adds new complexity to the balancing problem.

@hmusum hmusum added this to the later milestone Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants