Database / Weaviate Vector database Interview questions
What is a UUID's role for objects in Weaviate?
Every object stored in Weaviate, in every collection, is assigned a UUID that's guaranteed unique across the entire Weaviate instance, not just within its own collection. This universal uniqueness is what makes cross-collection references and direct object lookups by ID reliable and unambiguous.
import uuid obj_uuid = collection.data.insert( properties={"question": "What is the capital of France?", "answer": "Paris"}, uuid=uuid.uuid4() ) obj = collection.query.fetch_object_by_id(obj_uuid)
A UUID can be supplied explicitly at insert time (useful for keeping Weaviate's IDs in sync with an external system's own identifiers) or generated automatically by Weaviate if omitted, and because it's globally unique, the same UUID value can never accidentally refer to two different objects even across entirely unrelated collections.
More Related questions...