On Tue, Mar 20, 2018 at 2:09 PM, Vladimir Ozerov <[email protected]> wrote:
> Internally Ignite is key-value storage. It use key to derive partition it > belongs to. By default the whole key is used. Alternatively you can use > @AffinityKey annotation in cache API or "affinityKey" option in CREATE > TABLE to specify *part of the key* to be used for affinity calculation. > Affinity column cannot belong to value because in this case single > key-value pair could migrate between nodes during updates and > IgniteCache.get(K) will not be able to locate the key in cluster. > Vladimir, while it makes sense that the key must be composed of the ID and Affinity Key, I still do not understand why we require that user declares them both as PRIMARY KEY. Why do you need to enforce that explicitly? In my view you can do it automatically, if you see that the table has both, PRIMARY KEY and AFFINITY KEY declared.
