DashMap (Rust)

High-performance concurrent HashMap for Rust using a sharded lock design. DashMap provides thread-safe key-value storage that replaces Arc<Mutex<HashMap<K, V>>> with dramatically better concurrent performance. Uses fine-grained sharding (default 16 shards) so concurrent reads and writes to different shards don't contend. Drop-in ergonomic replacement for std::collections::HashMap in concurrent contexts.

Evaluated Mar 06, 2026 (0d ago) v6.x
Homepage ↗ Repo ↗ Developer Tools rust concurrent hashmap thread-safe lock-free performance open-source
&#9881; Agent Friendliness
66
/ 100
Can an agent use this?
&#128274; Security
88
/ 100
Is it safe for agents?
&#9889; Reliability
82
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
80
Error Messages
78
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
88
Auth Strength
88
Scope Granularity
88
Dep. Hygiene
88
Secret Handling
88

Memory safety guaranteed by Rust's borrow checker. Deadlock risks from cross-await reference holding — must be addressed at design time. No known security vulnerabilities.

⚡ Reliability

Uptime/SLA
85
Version Stability
82
Breaking Changes
78
Error Recovery
82
AF Security Reliability

Best When

You need a shared HashMap accessible from multiple threads/async tasks in Rust and want better performance than Arc<Mutex<HashMap>>.

Avoid When

Single-threaded code — std HashMap is faster; or use tokio::sync::RwLock<HashMap> if you prefer explicit lock semantics.

Use Cases

  • Replace Arc<Mutex<HashMap>> with DashMap for concurrent caches, session stores, or shared state in async Rust services
  • Build high-throughput concurrent registries (plugin registries, connection pools) where multiple threads read and write concurrently
  • Implement distributed counters or metrics accumulators that are updated from many async tasks simultaneously
  • Use as a concurrent cache in Axum/Actix-web services as shared application state (State<DashMap>)
  • Store per-request or per-user state in concurrent request handlers without blocking on a global mutex

Not For

  • Single-threaded applications — std HashMap is simpler and faster without concurrent overhead
  • Distributed caching across multiple processes — use Redis or distributed cache; DashMap is in-process only
  • Databases or persistent storage — DashMap is an in-memory data structure

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Library with no auth requirement.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

Free and open source.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • DashMap uses reference-counted shards — holding a Ref<K, V> or RefMut<K, V> reference across an .await point causes deadlocks; never hold DashMap references across async boundaries
  • DashMap's entry() API returns an OccupiedEntry or VacantEntry — the reference holds a shard lock; operations must complete before the guard is dropped
  • iter() on DashMap holds per-shard locks during iteration — long iterations block concurrent writers to the same shard; collect first if iteration is slow
  • DashMap is not fairness-guaranteed for writers — heavy read workloads can starve writers; consider tokio::sync::RwLock for write-priority scenarios
  • Cloning a DashMap clones the entire contents — for large maps, prefer Arc<DashMap> to share ownership without copying
  • DashMap versions have changed the API between major versions — ensure dashmap dependency version matches your usage; version 5.x and 6.x have incompatible changes

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for DashMap (Rust).

$99

Scores are editorial opinions as of 2026-03-06.

5208
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered