Get Started

Get Started

These guides demonstrate the operational flexibility and speed of the Hazelcast In-Memory Computing Platform. Set-up in seconds, data in microseconds. Operations and developer friendly.

Hazelcast IMDG

Find out for yourself how to get a Hazelcast IMDG cluster up and running. In this Getting Started guide you’ll learn how to:

  • Create a Cluster of 3 Members.
  • Start the Hazelcast Management Center.
  • Add data to the cluster using a sample client in the language of your choice.
  • Add and remove some cluster members to demonstrate the automatic rebalancing of data and back-ups.

Hazelcast Jet

Learn how to run a distributed data stream processing pipeline in Java. In this Getting Started guide you’ll learn how to:

  • Start a Hazelcast Jet cluster in your JVM.
  • Build the Word Count application.
  • Execute the application wit Jet.
  • Push testing data to the cluster and explore results

As a next step, you will be able explore the code samples and extend your setup more features and connectors.

Distribute Your Data

You’re an engineer who wants to distribute data for caching and sharing. Learn how to use Hazelcast data structures.

The quickest way to learn how to use Hazelcast IMDG is to start up a cluster and add some data to it. Check out the Getting Started Guide. Then we suggest you enroll in free training and take the Hazelcast IMDG Overview course. If you’re on the move, listen to a quick 10-minute podcast from one of the community engineers describing what Hazelcast is all about.

There are many caching technologies available, but we believe Hazelcast is the best, and here are seven reasons why.

Once you are ready to begin looking at the wider set of data structures, check out the extensive examples in all client languages. Links to each repository are below. For a quick start:

Here’s how you can add entries to a distributed map using a Java client

import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;

import java.util.Map;

public class FillMapMember {

    public static void main(String[] args) {
        HazelcastInstance hz = Hazelcast.newHazelcastInstance();
        Map<String, String> map = hz.getMap("map");
        map.put("1", "Tokyo");
        map.put("2", "Paris");
        map.put("3", "New York");
        System.out.println("Finished loading map");
    }
}

Here’s a simple predicate query over some data in Java

import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.map.IMap;
import com.hazelcast.query.Predicates;

import java.util.Set;

public class SqlQueryMember {

    public static void main(String[] args) {
        HazelcastInstance hz = Hazelcast.newHazelcastInstance();
        IMap<String, Customer> map = hz.getMap("map");

        map.put("1", new Customer("peter", true, 36));
        map.put("2", new Customer("john", false, 40));
        map.put("3", new Customer("roger", true, 20));

        Set employees = (Set) map.values(Predicates.sql("active AND age < 30"));
        System.out.println("Employees: " + employees);

        Hazelcast.shutdownAll();
    }
}

How about using a set in .NET?

using System;
using Hazelcast.Client;
using Hazelcast.Config;

namespace Hazelcast.Examples.Collections
{
    internal class SetExample
    {
        private static void Run(string[] args)
        {
            Environment.SetEnvironmentVariable("hazelcast.logging.level", "info");
            Environment.SetEnvironmentVariable("hazelcast.logging.type", "console");

            var config = new ClientConfig();
            config.GetNetworkConfig().AddAddress("127.0.0.1");
            var client = HazelcastClient.NewHazelcastClient(config);

            var set = client.GetSet("set-example");

            set.Add("item1");
            set.Add("item2");
            set.Add("item3");
            set.Add("item3");

            Console.WriteLine("Enumerator : " + string.Join(", ", set));

            Console.WriteLine("Contains: " + string.Join(", ", set.Contains("item2")));

            Console.WriteLine("Count: " + string.Join(", ", set.Count));

            set.Destroy();
            client.Shutdown();
        }
    }
}

Make use of the CRDT PN counter in Python

import hazelcast
import logging

if __name__ == "__main__":
    logging.basicConfig()
    logging.getLogger().setLevel(logging.INFO)

    client = hazelcast.HazelcastClient()

    pn_counter = client.get_pn_counter("pn-counter").blocking()

    print("Counter is initialized with {}".format(pn_counter.get()))

    for i in range(10):
        print("Added {} to the counter. Current value is {}".format(i, pn_counter.add_and_get(i)))

    print("Incremented the counter after getting the current value. "
          "Previous value is {}".format(pn_counter.get_and_increment()))

    print("Final value is {}".format(pn_counter.get()))

Generate a unique cluster-wide ID using Go

package main

import (
	"fmt"

	"github.com/hazelcast/hazelcast-go-client"
)

func main() {

	config := hazelcast.NewConfig()
	config.NetworkConfig().AddAddress("127.0.0.1:5701")
	client, err := hazelcast.NewClientWithConfig(config)
	if err != nil {
		fmt.Println(err)
		return
	}
	flakeIDGenerator, _ := client.GetFlakeIDGenerator("generator")
	id, _ := flakeIDGenerator.NewID()
	fmt.Printf("new id : %d", id)

	flakeIDGenerator.Destroy()
	client.Shutdown()

}

Free Hazelcast Online Training Center

Whether you're interested in learning the basics of in-memory systems, or you're looking for advanced, real-world production examples and best practices, we've got you covered.

Open Gitter Chat