0
votes

I am trying to create an Apache Ignite Cluster lately and is pretty new to this. I am facing a couple of issues when creating it and migrating an old database to Apache Ignite.

These are 2 issues which am facing now and is looking forward for inputs on that.

  1. I want to add Auto Incrementing Primary Key in the table. Is there any way to directly implement that in the database? I have seen that Apache Ignite doesn't support Auto Incrementing. I know we can add Auto Increment functionality from code, is there any way to implement it in the database itself.

  2. Adding the Affinity Keys. I have another field that i want to use as the Affinity Key and as far as i have seen, we can only add keys as Affinity Keys in Apache Ignite. The solution that I got is to use the second field as a Secondary Key. Is there any better solutions for this?

If you have any better solutions for these issues, please let me know.

Thanks and Regards

1

1 Answers

0
votes
  1. It’s not really possible to have an auto increment field in a distributed system without dramatically slowing it down. You can do it manually with IgniteAtomicSequence or IgniteAtomicLong. Or maybe use something like a UUID
  2. I’m not sure I understand your question. The affinity key needs to be part of the key. The whole key is unique, the affinity key tells Ignite which node the data should be stored on. More here: https://www.gridgain.com/docs/latest/developers-guide/data-modeling/affinity-collocation