{"id":15047264,"url":"https://github.com/hazelcast/hazelcast-cpp-client","last_synced_at":"2025-04-05T02:11:30.018Z","repository":{"id":37801286,"uuid":"44811655","full_name":"hazelcast/hazelcast-cpp-client","owner":"hazelcast","description":"Hazelcast IMDG C++ Client","archived":false,"fork":false,"pushed_at":"2025-03-25T07:57:28.000Z","size":56657,"stargazers_count":85,"open_issues_count":180,"forks_count":46,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-03-29T01:14:04.654Z","etag":null,"topics":["big-data","boost","c-plus-plus","caching","clustering","cmake","cpp","cpp98","datagrid","distributed","hazelcast","hazelcast-client","imdg","in-memory","library","linux","osx","scalability","windows"],"latest_commit_sha":null,"homepage":"https://hazelcast.com/clients/cplusplus/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hazelcast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-23T12:25:49.000Z","updated_at":"2025-03-25T07:57:32.000Z","dependencies_parsed_at":"2024-08-29T11:49:01.220Z","dependency_job_id":"4ba4d388-77fc-4420-8f91-ce861df279ad","html_url":"https://github.com/hazelcast/hazelcast-cpp-client","commit_stats":{"total_commits":1413,"total_committers":34,"mean_commits":41.55882352941177,"dds":0.5626326963906582,"last_synced_commit":"4a027a85f131d733b44d0ffb32b74b989269e0ec"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazelcast%2Fhazelcast-cpp-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazelcast%2Fhazelcast-cpp-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazelcast%2Fhazelcast-cpp-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazelcast%2Fhazelcast-cpp-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hazelcast","download_url":"https://codeload.github.com/hazelcast/hazelcast-cpp-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276189,"owners_count":20912288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["big-data","boost","c-plus-plus","caching","clustering","cmake","cpp","cpp98","datagrid","distributed","hazelcast","hazelcast-client","imdg","in-memory","library","linux","osx","scalability","windows"],"created_at":"2024-09-24T20:55:51.599Z","updated_at":"2025-04-05T02:11:30.000Z","avatar_url":"https://github.com/hazelcast.png","language":"C++","readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://hazelcast.com\"\u003e\n        \u003cimg class=\"center\" src=\"https://docs.hazelcast.com/_/img/hazelcast-logo.svg\" alt=\"logo\"\u003e\n    \u003c/a\u003e\n    \u003ch2 align=\"center\"\u003eHazelcast C++ Client\u003c/h2\u003e\n\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://hazelcastcommunity.slack.com/channels/cpp-client\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/slack-chat-green.svg\" alt=\"Chat on Slack\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://twitter.com/Hazelcast\"\u003e\n        \u003c!-- markdownlint-disable-next-line MD013 --\u003e\n        \u003cimg src=\"https://img.shields.io/twitter/follow/Hazelcast.svg?style=flat-square\u0026colorA=1da1f2\u0026colorB=\u0026label=Follow%20on%20Twitter\" alt=\"Follow on Twitter\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-Apache_2.0-blue.svg\" alt=\"Chat on Slack\"\u003e\n    \u003c/a\u003e    \n\u003c/p\u003e\n\n---\n\n# What is Hazelcast?\n\n[Hazelcast](https://hazelcast.com/) is a distributed computation and storage platform for consistently low-latency querying,\naggregation and stateful computation against event streams and traditional data sources. It allows you to quickly build\nresource-efficient, real-time applications. You can deploy it at any scale from small edge devices to a large cluster of\ncloud instances.\n\nA cluster of Hazelcast nodes share both the data storage and computational load which can dynamically scale up and down.\nWhen you add new nodes to the cluster, the data is automatically rebalanced across the cluster, and currently running\ncomputational tasks (known as jobs) snapshot their state and scale with processing guarantees.\n\nFor more info, check out Hazelcast [repository](https://github.com/hazelcast/hazelcast).\n\n\n# Hazelcast C++ Client\n\nhazelcast-cpp-client is the official C++ library API for using the Hazelcast in-memory database platform. It requires C++11 support.  \n\n\n## Installation\n### Hazelcast\nHazelcast C++ client requires a working Hazelcast cluster to run. This cluster handles the storage and\nmanipulation of the user data.\n\nA Hazelcast cluster consists of one or more cluster members. These members generally run on multiple virtual or\nphysical machines and are connected to each other via the network. Any data put on the cluster is partitioned to\nmultiple members transparent to the user. It is therefore very easy to scale the system by adding new members as\nthe data grows. Hazelcast cluster also offers resilience. Should any hardware or software problem causes a crash\nto any member, the data on that member is recovered from backups and the cluster continues to operate without any\ndowntime.\n\nThe quickest way to start a single member cluster for development purposes is to use our\n[Docker images](https://hub.docker.com/r/hazelcast/hazelcast/).\n\n```bash\ndocker run -p 5701:5701 hazelcast/hazelcast\n```\n\nThis command fetches the latest Hazelcast version. You can find all available tags\n[here](https://hub.docker.com/r/hazelcast/hazelcast/tags).\n\nYou can also use our ZIP or TAR [distributions](https://hazelcast.com/open-source-projects/downloads/)\nas described [here](Reference_Manual.md#12-starting-hazelcast-cluster).\n\n### Client\n\n#### Vcpkg Users\nHazelcast C++ client package is available for [Vcpkg](https://github.com/microsoft/vcpkg) users. The package name is `hazelcast-cpp-client`.\n\nPlease see [getting started](https://github.com/microsoft/vcpkg#getting-started) on how to use Vcpkg package manager with your application. In summary,\n\nIf you use Linux or Mac:\n\n```sh\ngit clone https://github.com/microsoft/vcpkg\n./vcpkg/bootstrap-vcpkg.sh\n./vcpkg/vcpkg install \"hazelcast-cpp-client[openssl]\" --recurse\n``` \n\nIf you use Windows:\n\n```bat\ngit clone https://github.com/microsoft/vcpkg\n.\\vcpkg\\bootstrap-vcpkg.bat\n.\\vcpkg\\vcpkg install \"hazelcast-cpp-client[openssl]:x64-windows\" --recurse\n``` \nThe above code snippet will install `hazelcast-cpp-client` with its `boost` and `openssl` dependencies.\n\nAfter 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`.\n```bat\ncmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake\ncmake --build [build directory]\n```\n\n##### Other Methods\n\nYou can also install the hazelcast-cpp-client with [conan](https://conan.io/) and from source code. You can more information from [Reference Manual](https://github.com/akeles85/hazelcast-cpp-client/blob/readme_update/Reference_Manual.md#11-installing).\n\n## Overview\n\n### Usage\n\nThere is an example project in [sample_project](https://github.com/akeles85/hazelcast-cpp-client/tree/readme_update/sample_project) directory. You can run the example as below:\n\nIf you use Linux or Mac:\n\n```sh\ncmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake\ncmake --build build\n./build/client\n```\n\nIf you use Windows:\n\n```bat\ncmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]\\scripts\\buildsystems\\vcpkg.cmake \u0026\u0026 ^ \ncmake --build build \u0026\u0026 ^\n.\\build\\Debug\\client\n```\n\nThe sample code creates a client, the client automatically connects to the cluster.\nIt creates a map named `personnel_map` and puts the records inside it.\nIt then gets all the entries from the cluster and prints them.\n```c++\n#include \u003chazelcast/client/hazelcast_client.h\u003e\nint main() {\n    auto hz = hazelcast::new_client().get(); // Connects to the cluster\n\n    auto personnel = hz.get_map(\"personnel_map\").get();\n    personnel-\u003eput\u003cstd::string, std::string\u003e(\"Alice\", \"IT\").get();\n    personnel-\u003eput\u003cstd::string, std::string\u003e(\"Bob\", \"IT\").get();\n    personnel-\u003eput\u003cstd::string, std::string\u003e(\"Clark\", \"IT\").get();\n    std::cout \u003c\u003c \"Added IT personnel. Logging all known personnel\" \u003c\u003c std::endl;\n    for (const auto \u0026entry : personnel-\u003eentry_set\u003cstd::string, std::string\u003e().get()) {\n        std::cout \u003c\u003c entry.first \u003c\u003c \" is in \" \u003c\u003c entry.second \u003c\u003c \" department.\" \u003c\u003c std::endl;\n    }\n    \n    return 0;\n}\n```\n\n## Features\n\n* Distributed, partitioned and queryable in-memory key-value store implementation, called [Map](examples/distributed-map/basic/FillMap.cpp)\n* Eventually consistent cache implementation to store a subset of the Map data locally in the memory of the client, called [Near Cache](examples/distributed-map/near-cache)\n* Additional data structures and simple messaging constructs such as [Set](examples/distributed-collections/set), [MultiMap](https://github.com/hazelcast/hazelcast-cpp-client/blob/master/examples/distributed-map/multimap/MultimapPut.cpp), [Queue](examples/distributed-collections/blockingqueue), [Topic](examples/distributed-topic)\n* Cluster-wide unique ID generator, called [FlakeIdGenerator](https://github.com/hazelcast/hazelcast-cpp-client/tree/master/examples/learning-basics/unique-names)\n* Distributed, CRDT based counter, called [PNCounter](examples/distributed-primitives/crdt-pncounter)\n* Distributed concurrency primitives from CP Subsystem such as [FencedLock](examples/cp/fenced_lock.cpp), [Semaphore](examples/cp/counting_semphore.cpp), [AtomicLong](examples/cp/atomic_long.cpp)\n* Integration with [Viridian](https://viridian.hazelcast.com/) (Hazelcast Cloud)\n* Support for serverless and traditional web service architectures with **Unisocket** and **Smart** operation modes\n* Ability to listen client lifecycle, cluster state and distributed data structure events\n* and [many more](https://hazelcast.com/clients/cplusplus/#client-features).\n\n## Documentation\n\nYou can find the detailed documentation at the [documentation site](https://hazelcast.github.io/hazelcast-cpp-client/doc-index.html) and the [API reference](https://hazelcast.github.io/hazelcast-cpp-client/api-index.html).\n\n## Copyright\n\nCopyright (c) 2008-2023, Hazelcast, Inc. All Rights Reserved.\n\nVisit [www.hazelcast.com](http://www.hazelcast.com) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazelcast%2Fhazelcast-cpp-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhazelcast%2Fhazelcast-cpp-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazelcast%2Fhazelcast-cpp-client/lists"}