vespa-engine / vespa

AI + Data, online. https://vespa.ai
https://vespa.ai
Apache License 2.0
5.58k stars 586 forks source link

Vespa tenants vs document types trade-offs #22631

Closed nehajatav closed 2 years ago

nehajatav commented 2 years ago

We manage search platform for 38+ document schemas. We would like to understand

  1. the trade-off between managing these in different doc types versus different tenants
  2. how to perform feed and search for a given tenant?
kkraune commented 2 years ago

Open-source Vespa is primarily used in single-tenant mode. Refer to https://docs.vespa.ai/en/schemas.html#multiple-schemas and https://docs.vespa.ai/en/federation.html to understand multi-schema usage.

By default, Vespa queries all schemas.

If an application query is across all 38 schemas, Vespa works out of the box, a higher query timeout might be needed Note that this translates to 38 queries inside Vespa, thread tuning might be needed to lower latency.

If an application query is within one or a few schemas use restrict to query only the required schemas. https://docs.vespa.ai/en/reference/query-api-reference.html#model.restrict . It seems to me from your question that a tenant in your case maps to a schema.

In any case, use https://docs.vespa.ai/en/query-api.html#query-tracing to understand behavior and performance.

nehajatav commented 2 years ago

Thanks @kkraune , that's helpful!