what is affinity in practical terms. and affinity is predefined term or we need to make affinity function?
Affinity is a function that maps any cache key to a node where entry for this key is stored. It's pluggable in Ignite, so you're free to create your own function, but in 99.(9)% of use cases it's not needed and you can just use the default one provided out of the box.
Please let us know if you have any specific follow up questions.