Hazelcast C++ Client
Hazelcast C++ Client Library
|
Hazelcast is a distributed computation and storage platform for consistently low-latency querying, aggregation and stateful computation against event streams and traditional data sources. It allows you to quickly build resource-efficient, real-time applications. You can deploy it at any scale from small edge devices to a large cluster of cloud instances.
A cluster of Hazelcast nodes share both the data storage and computational load which can dynamically scale up and down. When you add new nodes to the cluster, the data is automatically rebalanced across the cluster, and currently running computational tasks (known as jobs) snapshot their state and scale with processing guarantees.
For more info, check out Hazelcast repository.
hazelcast-cpp-client is the official C++ library API for using the Hazelcast in-memory database platform. It requires C++11 support.
Hazelcast C++ client requires a working Hazelcast cluster to run. This cluster handles the storage and manipulation of the user data.
A Hazelcast cluster consists of one or more cluster members. These members generally run on multiple virtual or physical machines and are connected to each other via the network. Any data put on the cluster is partitioned to multiple members transparent to the user. It is therefore very easy to scale the system by adding new members as the data grows. Hazelcast cluster also offers resilience. Should any hardware or software problem causes a crash to any member, the data on that member is recovered from backups and the cluster continues to operate without any downtime.
The quickest way to start a single member cluster for development purposes is to use our Docker images.
This command fetches the latest Hazelcast version. You can find all available tags here.
You can also use our ZIP or TAR distributions as described here.
Hazelcast C++ client package is available for Vcpkg users. The package name is hazelcast-cpp-client
.
Please see getting started on how to use Vcpkg package manager with your application. In summary,
If you use Linux or Mac:
If you use Windows:
The above code snippet will install hazelcast-cpp-client
with its boost
and openssl
dependencies.
After the installation, the library is available for usage. For example, if you are using CMake for your builds, you can use the following cmake build command with the CMAKE_TOOLCHAIN_FILE
cmake option to be the vcpkg.cmake
.
You can also install the hazelcast-cpp-client with conan and from source code. You can more information from Reference Manual.
There is an example project in sample_project directory. You can run the example as below:
If you use Linux or Mac:
If you use Windows:
The sample code creates a client, the client automatically connects to the cluster. It creates a map named personnel_map
and puts the records inside it. It then gets all the entries from the cluster and prints them.
You can find the detailed documentation at the documentation site and the API reference.
Copyright (c) 2008-2023, Hazelcast, Inc. All Rights Reserved.
Visit www.hazelcast.com for more information.