We need an external unique ID for each entity (type). For example: Device, user, Measurement.
ID type is UUID4 => 437e8c3b-0b92-4e9f-b111-f361b22a5888
Our first thought was:
uuid: string @index(exact) @upsert .
Our concern for performance raised the following questions:
- Is
stringis the most efficient type? Maybe list of bytes (is it possible?) - Which index foot print is smaller? hash or exact? The
uuidis 128bit, but it is also saved as UTF8 which is more bloated than binary. - Should we split the
uuidto types, likeuser.uuid,device.uuidand etc, And that to avoid over bloated index?
Other thoughts (of less urgency but interesting non the less).
- split the
uuidand search by the prefix and filter by the suffix:uuid_prefix => 437e8c3buuid_postfix => 0b92-4e9f-b111-f361b22a5888
Or maybe write a custom tokenizer that specialize with uuid?