All Projects → hazelcast → Hazelcast Python Client

hazelcast / Hazelcast Python Client

Licence: apache-2.0
Hazelcast IMDG Python Client

Programming Languages

python
139335 projects - #7 most used programming language
python2
120 projects

Projects that are alternatives of or similar to Hazelcast Python Client

Hazelcast Cpp Client
Hazelcast IMDG C++ Client
Stars: ✭ 67 (-27.17%)
Mutual labels:  big-data, caching, in-memory, clustering, scalability, distributed, datagrid
Hazelcast
Open-source distributed computation and storage platform
Stars: ✭ 4,662 (+4967.39%)
Mutual labels:  big-data, caching, in-memory, clustering, scalability, distributed, datagrid
Hazelcast Nodejs Client
Hazelcast IMDG Node.js Client
Stars: ✭ 124 (+34.78%)
Mutual labels:  big-data, caching, in-memory, clustering, scalability, distributed, datagrid
Hazelcast Go Client
Hazelcast IMDG Go Client
Stars: ✭ 140 (+52.17%)
Mutual labels:  big-data, caching, in-memory, clustering, scalability, distributed, datagrid
hazelcast-csharp-client
Hazelcast .NET Client
Stars: ✭ 98 (+6.52%)
Mutual labels:  caching, big-data, clustering, scalability, distributed, in-memory, datagrid
Coherence
Oracle Coherence Community Edition
Stars: ✭ 328 (+256.52%)
Mutual labels:  caching, in-memory, clustering, scalability, distributed
insightedge
InsightEdge Core
Stars: ✭ 22 (-76.09%)
Mutual labels:  big-data, distributed, in-memory, datagrid
Olric
Distributed cache and in-memory key/value data store. It can be used both as an embedded Go library and as a language-independent service.
Stars: ✭ 2,067 (+2146.74%)
Mutual labels:  caching, in-memory, distributed
Moosefs
MooseFS – Open Source, Petabyte, Fault-Tolerant, Highly Performing, Scalable Network Distributed File System (Software-Defined Storage)
Stars: ✭ 1,025 (+1014.13%)
Mutual labels:  big-data, clustering, scalability
nebula
A distributed, fast open-source graph database featuring horizontal scalability and high availability
Stars: ✭ 8,196 (+8808.7%)
Mutual labels:  big-data, scalability, distributed
Clustering4Ever
C4E, a JVM friendly library written in Scala for both local and distributed (Spark) Clustering.
Stars: ✭ 126 (+36.96%)
Mutual labels:  big-data, clustering, scalability
dxram
A distributed in-memory key-value storage for billions of small objects.
Stars: ✭ 25 (-72.83%)
Mutual labels:  big-data, distributed, in-memory
hekate
Java Library for Distributed Services
Stars: ✭ 17 (-81.52%)
Mutual labels:  scalability, distributed
Crate
CrateDB is a distributed SQL database that makes it simple to store and analyze massive amounts of data in real-time.
Stars: ✭ 3,254 (+3436.96%)
Mutual labels:  big-data, distributed
pytorch kmeans
Implementation of the k-means algorithm in PyTorch that works for large datasets
Stars: ✭ 38 (-58.7%)
Mutual labels:  big-data, clustering
Infinit
The Infinit policy-based software-defined storage platform.
Stars: ✭ 363 (+294.57%)
Mutual labels:  scalability, distributed
Scanner
Efficient video analysis at scale
Stars: ✭ 569 (+518.48%)
Mutual labels:  big-data, distributed
Nebulex
In-memory and distributed caching toolkit for Elixir.
Stars: ✭ 662 (+619.57%)
Mutual labels:  caching, distributed
Titanoboa
Titanoboa makes complex workflows easy. It is a low-code workflow orchestration platform for JVM - distributed, highly scalable and fault tolerant.
Stars: ✭ 787 (+755.43%)
Mutual labels:  big-data, distributed
gocache
High performance and lightweight in-memory cache library with LRU and FIFO support as well as memory-usage-based-eviction
Stars: ✭ 15 (-83.7%)
Mutual labels:  caching, in-memory

Hazelcast Python Client

.. image:: https://img.shields.io/pypi/v/hazelcast-python-client :target: https://pypi.org/project/hazelcast-python-client/ :alt: PyPI .. image:: https://img.shields.io/readthedocs/hazelcast :target: https://hazelcast.readthedocs.io :alt: Read the Docs .. image:: https://hz-community-slack.herokuapp.com/badge.svg :target: https://slack.hazelcast.com :alt: Join the community on Slack .. image:: https://img.shields.io/pypi/l/hazelcast-python-client :target: https://github.com/hazelcast/hazelcast-python-client/blob/master/LICENSE.txt :alt: License


Hazelcast <https://hazelcast.org/>__ is an open-source distributed in-memory data store and computation platform that provides a wide variety of distributed data structures and concurrency primitives.

Hazelcast Python client is a way to communicate to Hazelcast IMDG clusters and access the cluster data. The client provides a Future-based asynchronous API suitable for wide ranges of use cases.

Installation

Hazelcast


Hazelcast Python client requires a working Hazelcast IMDG cluster to
run. This cluster handles the storage and manipulation of the user data.

A Hazelcast IMDG 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 IMDG 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 <https://hub.docker.com/r/hazelcast/hazelcast/>`__.

.. code:: bash

   docker run -p 5701:5701 hazelcast/hazelcast:4.1

You can also use our ZIP or TAR
`distributions <https://hazelcast.org/imdg/download/archives/#hazelcast-imdg>`__.
Once you have downloaded, you can start the Hazelcast member using
the ``bin/start.sh`` script.

Client
~~~~~~

.. code:: bash

   pip install hazelcast-python-client

Overview
--------

Usage
~~~~~

.. code:: python

    import hazelcast

    # Connect to Hazelcast cluster.
    client = hazelcast.HazelcastClient()

    # Get or create the "distributed-map" on the cluster.
    distributed_map = client.get_map("distributed-map")

    # Put "key", "value" pair into the "distributed-map" and wait for
    # the request to complete.
    distributed_map.set("key", "value").result()

    # Try to get the value associated with the given key from the cluster
    # and attach a callback to be executed once the response for the
    # get request is received. Note that, the set request above was
    # blocking since it calls ".result()" on the returned Future, whereas
    # the get request below is non-blocking.
    get_future = distributed_map.get("key")
    get_future.add_done_callback(lambda future: print(future.result()))

    # Do other operations. The operations below won't wait for
    # the get request above to complete.

    print("Map size:", distributed_map.size().result())

    # Shutdown the client.
    client.shutdown()


If you are using Hazelcast IMDG and the Python client on the same
machine, the default configuration should work out-of-the-box. However,
you may need to configure the client to connect to cluster nodes that
are running on different machines or to customize client properties.

Configuration

.. code:: python

import hazelcast

client = hazelcast.HazelcastClient(
    cluster_name="cluster-name",
    cluster_members=[
        "10.90.0.2:5701",
        "10.90.0.3:5701",
    ],
    lifecycle_listeners=[
        lambda state: print("Lifecycle event >>>", state),
    ]
)

print("Connected to cluster")
client.shutdown()

Refer to the documentation <https://hazelcast.readthedocs.io>__ to learn more about supported configuration options.

Features

  • Distributed, partitioned and queryable in-memory key-value store implementation, called Map
  • Eventually consistent cache implementation to store a subset of the Map data locally in the memory of the client, called Near Cache
  • Additional data structures and simple messaging constructs such as Set, MultiMap, Queue, Topic
  • Cluster-wide unique ID generator, called FlakeIdGenerator
  • Distributed, CRDT based counter, called PNCounter
  • Distributed concurrency primitives from CP Subsystem such as FencedLock, Semaphore, AtomicLong
  • Integration with Hazelcast Cloud <https://cloud.hazelcast.com/>__
  • Support for serverless and traditional web service architectures with Unisocket and Smart operation modes
  • Ability to listen to client lifecycle, cluster state, and distributed data structure events
  • and many more <https://hazelcast.org/imdg/clients-languages/python/#client-features>__

Getting Help

You can use the following channels for your questions and development/usage issues:

  • GitHub repository <https://github.com/hazelcast/hazelcast-python-client/issues/new>__
  • Documentation <https://hazelcast.readthedocs.io>__
  • Slack <https://slack.hazelcast.com>__
  • Google Groups <https://groups.google.com/g/hazelcast>__
  • Stack Overflow <https://stackoverflow.com/questions/tagged/hazelcast>__

Contributing

We encourage any type of contribution in the form of issue reports or pull requests.

Issue Reports


For issue reports, please share the following information with us to
quickly resolve the problems:

-  Hazelcast IMDG and the client version that you use
-  General information about the environment and the architecture you
   use like Python version, cluster size, number of clients, Java
   version, JVM parameters, operating system etc.
-  Logs and stack traces, if any
-  Detailed description of the steps to reproduce the issue

Pull Requests

Contributions are submitted, reviewed and accepted using the pull requests on GitHub. For an enhancement or larger feature, please create a GitHub issue first to discuss.

Development ^^^^^^^^^^^

  1. Clone the GitHub repository <https://github.com/hazelcast/hazelcast-python-client.git>__.
  2. Run python setup.py install to install the Python client.

If you are planning to contribute:

  1. Run pip install -r requirements-dev.txt to install development dependencies.
  2. Use black <https://pypi.org/project/black/>__ to reformat the code by running the black --config black.toml . command.
  3. Make sure that tests are passing by following the steps described in the next section.

Testing ^^^^^^^

In order to test Hazelcast Python client locally, you will need the following:

  • Java 8 or newer
  • Maven

Following commands starts the tests:

.. code:: bash

python run_tests.py

Test script automatically downloads hazelcast-remote-controller and Hazelcast IMDG. The script uses Maven to download those.

License

Apache 2.0 License <LICENSE>__.

Copyright

Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved.

Visit www.hazelcast.com <http://www.hazelcast.com>__ for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].