Apache Ignite.NET Documentation

The Apache Ignite .NET Developer Hub

Welcome to the Apache Ignite .NET developer hub. You'll find comprehensive guides and documentation to help you start working with Apache Ignite.NET as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Colocate Compute and Data

Colocate your computations with the data.

Colocation of computations with data allow for minimizing data serialization within network and can significantly improve performance and scalability of your application. Whenever possible, you should always make best effort to colocate your computations with the cluster nodes caching the data that needs to be processed.

Affinity Call and Run Methods

AffinityCall(...) and AffinityRun(...) methods co-locate jobs with nodes on which data is cached. In other words, given a cache name and affinity key these methods try to locate the node on which the key resides on Ignite the specified Ignite cache, and then execute the job there.

private void AffinityRun()
    using (var ignite = Ignition.Start())
        var compute = ignite.GetCluster().ForRemotes().GetCompute();

        int key = 5;

        // This closure will execute on the remote node where
        // data with the 'key' is located.
        compute.AffinityRun("myCache", key, new ComputeAction {Key = key});

class ComputeAction : IComputeAction
    private readonly IIgnite ignite;

    public int Key { get; set; }

    public void Invoke()
        // Peek is a local memory lookup.
        string value = ignite.GetCache<int, string>("myCache").LocalPeek(Key);

        Console.WriteLine("Co-located [key={0}, value={1}]", Key, value);