You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by "Roger Fischer (CW)" <rf...@Brocade.com> on 2017/07/06 20:43:31 UTC

Large Key, eg UUID or String

Hello,

are there any concerns about larg-ish keys, like a UUID?

What if even larger, like a string of variable length?

I am using Ignite SQL.

Some objects have a single primary key, and in most cases it is a UUID. I am trying to decide if we should
a) create an artificial key (long) and have an id field (the UUID), or
b) use the UUID as the key (and have no query field for id, only the Java POJO field).

Other objects have a composite primary key. Again I have the choice to either
a) use an artificial Long as the key, or
b) concatenate the fields into a string and us the string as the key.
In this case I also need the individual fields as query fields. All queries are by field predicates (never by key).

Lastly, can Ignite generate a unique one on insert?

Thanks...

Roger


Re: Large Key, eg UUID or String

Posted by vkulichenko <va...@gmail.com>.
Hi Roger,

It's perfectly fine to use UUID as a key. In case of composite key I would
recommend to create a class with multiple fields to encapsulate all values
there.

Auto generation is not supported, at least for now.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Large-Key-eg-UUID-or-String-tp14416p14417.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.