PHPackages                             withinboredom/distributed-hashmap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. withinboredom/distributed-hashmap

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

withinboredom/distributed-hashmap
=================================

A distributed hashmap for Dapr state stores.

v0.0.1(4y ago)30[1 issues](https://github.com/withinboredom/distributed-hashmap/issues)[1 PRs](https://github.com/withinboredom/distributed-hashmap/pulls)GPL-2.0-or-laterC#PHP &gt;=8.0

Since May 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/withinboredom/distributed-hashmap)[ Packagist](https://packagist.org/packages/withinboredom/distributed-hashmap)[ RSS](/packages/withinboredom-distributed-hashmap/feed)WikiDiscussions main Synced 5d ago

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

distributed-hashmap
===================

[](#distributed-hashmap)

A Distributed hashmap for Dapr.

This is a simplistic lock-free implementation of a hashmap that allows fast concurrent writes. It works almost like a regular hashmap except instead of using memory, it uses Dapr State.

Features
--------

[](#features)

1. Subscribe/unsubscribe to key changes/deletes/inserts.
2. Supported in multiple languages.
3. Have a large list of items without worrying about race conditions.

Implementations:
----------------

[](#implementations)

- PHP [source](reference/php) [Packagist](https://packagist.org/packages/withinboredom/distributed-hashmap)
- C# [source](reference/csharp) [Nuget](https://www.nuget.org/packages/DistributedHashMap/0.0.1)

Limitations
-----------

[](#limitations)

There are several limitations with the current version:

### Size

[](#size)

There's no way to get the number of keys in the hashmap without causing contention or having to iterate over every bucket. Therefore, it simply is not a provided function. Open an issue if you want this anyway.

### Rebuilding

[](#rebuilding)

When creating the hashmap, please try to guess at the number of keys you may have stored and the maximum load of each bucket. If the maximum keys are set too small or the maximum load is too large, you may end up with too much contention or unexpected rebuilds of the hashmap.

Once `maxLoad` number of items are in a hashmap bucket, a rebuild is triggered. This means every reader/writer of the hashmap will immediately start copying all keys from the hashmap into a new generation of the hashmap. Every reader/writer needs to participate to ensure redundancy because they do not coordinate. Old keys from previous generations are not deleted. While this is pretty fast, it still takes several minutes once the size of the hashmap grows beyond ~100,000 items.

### Concurrency

[](#concurrency)

In my experiments, there isn't many issues with concurrency except how different languages approach parallel tasks. For example, forking in PHP results in very little overhead allowing over 2000 threads to concurrently write to a hashmap with very little overhead, while C# tends to bog down after the number of actively writing threads goes over the number of physical cores on the machine.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1817d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f5995953815a492e3bf6276044042d84035247139141ec7fd013c13af4e6dd4?d=identicon)[withinboredom](/maintainers/withinboredom)

---

Top Contributors

[![withinboredom](https://avatars.githubusercontent.com/u/1883296?v=4)](https://github.com/withinboredom "withinboredom (84 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/withinboredom-distributed-hashmap/health.svg)

```
[![Health](https://phpackages.com/badges/withinboredom-distributed-hashmap/health.svg)](https://phpackages.com/packages/withinboredom-distributed-hashmap)
```

###  Alternatives

[bitwasp/bitcoin

PHP Bitcoin library with functions for transactions, signatures, serialization, Random/Deterministic ECDSA keys, blocks, RPC bindings

1.1k533.2k43](/packages/bitwasp-bitcoin)[unleash/client

633.1M8](/packages/unleash-client)[optimizely/optimizely-sdk

Optimizely PHP SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts

191.8M1](/packages/optimizely-optimizely-sdk)[protonlabs/bitcoin

PHP Bitcoin library with functions for transactions, signatures, serialization, Random/Deterministic ECDSA keys, blocks, RPC bindings

33187.4k8](/packages/protonlabs-bitcoin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
