# workiva/go-datastructures

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/workiva-go-datastructures).**

7,901 stars · 843 forks · Go · apache-2.0

## Links

- GitHub: https://github.com/Workiva/go-datastructures
- awesome-repositories: https://awesome-repositories.com/repository/workiva-go-datastructures.md

## Description

go-datastructures is a collection of thread-safe and lock-free data structures designed for high-performance concurrent applications in Go. It provides a modular library of specialized algorithmic toolsets, including a lock-free collection library and an immutable data structure library.

The project distinguishes itself through a suite of persistent AVL trees and hash array mapped tries that use branch-copying to preserve previous versions. It also implements non-blocking hash maps, queues, and tries that enable linearizable snapshots and concurrent updates without the use of mutual exclusion locks.

The library covers a broad range of capability areas, including dimensional indexing for range querying, graph algorithms optimized with Fibonacci heaps, and fast integer set operations using sparse bitmaps. It further includes ordered collections such as skiplists and B+ trees, as well as multithreaded bucket sorting for large datasets.

The toolset also provides synchronization primitives like thread-safe ring buffers and event broadcasting mechanisms for coordinating execution between Go routines.

## Tags

### Programming Languages & Runtimes

- [Concurrent Data Structures](https://awesome-repositories.com/f/programming-languages-runtimes/concurrent-data-structures.md) — Ships a comprehensive collection of thread-safe and lock-free data structures for high-performance concurrent Go applications.
- [Persistent Data Structures](https://awesome-repositories.com/f/programming-languages-runtimes/persistent-data-structures.md) — Implements persistent data structures that preserve previous versions through branch-copying and structural sharing.
- [Immutable Data Structures](https://awesome-repositories.com/f/programming-languages-runtimes/programming-utilities/data-structure-type-helpers/data-structures/specialized-memory-formats/immutable-data-structures.md) — Provides a suite of immutable data structures, including persistent AVL trees and hash array mapped tries.

### Data & Databases

- [Hash Array Mapped Tries](https://awesome-repositories.com/f/data-databases/hash-data-structures/hash-array-mapped-tries.md) — Provides hash array mapped tries that optimize memory and enable fast lookups and snapshots.
- [Lock-Free Map Structures](https://awesome-repositories.com/f/data-databases/read-replicas/lock-free-map-structures.md) — Provides a lock-free hash array mapped trie that supports linearizable snapshots of the entire data set. ([source](https://github.com/Workiva/go-datastructures#readme))
- [Bitmapped Sets](https://awesome-repositories.com/f/data-databases/set-data-structures/bitmapped-sets.md) — Provides dense and sparse bitmaps for fast bitwise comparisons and intersections between integer sets. ([source](https://github.com/Workiva/go-datastructures/blob/master/documentation.md))
- [Priority Queues](https://awesome-repositories.com/f/data-databases/data-structure-implementations/optimized-data-structures/priority-queues.md) — Provides priority queues with floating-point keys and efficient decrease-key operations for graph algorithms. ([source](https://github.com/Workiva/go-datastructures/blob/master/documentation.md))
- [Undirected Graph Models](https://awesome-repositories.com/f/data-databases/graph-data-models/undirected-graph-models.md) — Implements a mutable undirected graph structure that manages vertices and edges without self-loops or parallel edges. ([source](https://github.com/Workiva/go-datastructures#readme))
- [Integer Hash Sets](https://awesome-repositories.com/f/data-databases/integer-hash-sets.md) — Implements a fast hashing algorithm with linear probing to check for the presence of integers. ([source](https://github.com/Workiva/go-datastructures#readme))
- [Integer Tries](https://awesome-repositories.com/f/data-databases/integer-tries.md) — Provides tries that treat integers as words to execute rapid predecessor and successor queries. ([source](https://github.com/Workiva/go-datastructures#readme))
- [Skiplists](https://awesome-repositories.com/f/data-databases/ordered-data-structures/skiplists.md) — Implements a skiplist for storing data in an ordered sequence with logarithmic operation complexity. ([source](https://github.com/Workiva/go-datastructures/blob/master/README.md))
- [Bitmapped Integer Sets](https://awesome-repositories.com/f/data-databases/result-set-search/multi-result-set-fetching/set-operation-engines/bitmapped-integer-sets.md) — Provides fast integer set operations and existence tracking using compressed sparse and dense bitmaps.
- [Sparse Bit-Arrays](https://awesome-repositories.com/f/data-databases/sparse-arrays/sparse-bit-arrays.md) — Tracks integer sets using compressed bit-fields to reduce memory overhead compared to traditional hash maps.
- [B-Tree](https://awesome-repositories.com/f/data-databases/storage-engines/b-tree.md) — Implements a B+ tree that leverages cache locality to improve disk-efficiency and lookup performance. ([source](https://github.com/Workiva/go-datastructures/blob/master/README.md))
- [Immutable B-Trees](https://awesome-repositories.com/f/data-databases/storage-engines/b-tree/immutable-b-trees.md) — Provides concurrency-focused B-trees supporting bulk operations and optional persistence. ([source](https://github.com/Workiva/go-datastructures/blob/master/README.md))
- [Unordered Unique Collection Management](https://awesome-repositories.com/f/data-databases/unordered-unique-collection-management.md) — Provides unordered collections of unique elements that support simultaneous concurrent reads. ([source](https://github.com/Workiva/go-datastructures/blob/master/documentation.md))

### Education & Learning Resources

- [Red-Black Trees](https://awesome-repositories.com/f/education-learning-resources/educational-resources/algorithms-theory-academics/cs-theory-foundations/data-structure-implementations/data-structures/balanced-search-trees/red-black-trees.md) — Implements a red-black binary search tree to find exact or approximate overlaps between n-dimensional ranges. ([source](https://github.com/Workiva/go-datastructures/blob/master/documentation.md))
- [Augmented Trees](https://awesome-repositories.com/f/education-learning-resources/educational-resources/algorithms-theory-academics/cs-theory-foundations/data-structure-implementations/data-structures/balanced-search-trees/red-black-trees/augmented-trees.md) — Implements augmented red-black trees to perform n-dimensional range and intersection queries.

### Operating Systems & Systems Programming

- [Lock-Free Atomic Containers](https://awesome-repositories.com/f/operating-systems-systems-programming/lock-free-atomic-containers.md) — Enables constant-time snapshots of hash array mapped tries without using locks to block access. ([source](https://github.com/Workiva/go-datastructures/blob/master/README.md))

### Software Engineering & Architecture

- [Concurrency Synchronization Primitives](https://awesome-repositories.com/f/software-engineering-architecture/concurrency-synchronization-primitives.md) — Uses compare-and-swap atomic primitives to manage concurrent access to queues and buffers without mutexes.
- [Lock-Free State Management](https://awesome-repositories.com/f/software-engineering-architecture/concurrent-execution-managers/asynchronous-concurrency-managers/lock-free-state-management.md) — Implements lock-free mechanisms for managing shared memory and state synchronization across multiple threads.
- [Lock-Free](https://awesome-repositories.com/f/software-engineering-architecture/queues/lock-free.md) — Provides first-in-first-out and priority queues with non-blocking sends and safe disposal. ([source](https://github.com/Workiva/go-datastructures/blob/master/README.md))
- [Immutable Transformations](https://awesome-repositories.com/f/software-engineering-architecture/trees/immutable-transformations.md) — Implements thread-safe AVL trees using branch-copying techniques to preserve previous versions of the data structure.
- [Thread-Safe State Transitions](https://awesome-repositories.com/f/software-engineering-architecture/background-thread-dispatchers/thread-safe-dispatchers/thread-safe-state-transitions.md) — Offers utilities and thread-safe types to coordinate safe concurrent updates across multiple threads. ([source](https://github.com/Workiva/go-datastructures/blob/master/README.md))
- [Fibonacci](https://awesome-repositories.com/f/software-engineering-architecture/heaps/fibonacci.md) — Provides Fibonacci heaps with efficient decrease-key operations to optimize shortest-path graph algorithms.
- [Persistent](https://awesome-repositories.com/f/software-engineering-architecture/linked-lists/persistent.md) — Provides a functional persistent linked list that preserves versions through cons-style manipulation. ([source](https://github.com/Workiva/go-datastructures#readme))
- [Blocking Synchronization](https://awesome-repositories.com/f/software-engineering-architecture/producer-consumer-workflow-managers/blocking-synchronization.md) — Ships a thread-safe blocking queue with compare-and-swap operations to coordinate execution and resource cleanup. ([source](https://github.com/Workiva/go-datastructures/blob/master/README.md))
- [Shared Memory Management](https://awesome-repositories.com/f/software-engineering-architecture/shared-memory-management.md) — Provides locks and synchronization primitives to protect shared memory accessed by multiple concurrent processes. ([source](https://github.com/Workiva/go-datastructures/blob/master/documentation.md))
- [Bucket Sorts](https://awesome-repositories.com/f/software-engineering-architecture/sorting-algorithms/bucket-sorts.md) — Implements a multithreaded bucket sort and symmetrical merge to accelerate large-scale sorting operations.
- [Parallel](https://awesome-repositories.com/f/software-engineering-architecture/sorting-algorithms/parallel.md) — Implements multithreaded bucket sorting and symmetrical merging to accelerate the organization of massive datasets.
- [Specialized Data Structures](https://awesome-repositories.com/f/software-engineering-architecture/specialized-data-structures.md) — Provides a specialized toolset of Fibonacci heaps, X-Fast tries, and B+ trees for optimized range queries and graph algorithms.
- [X-Fast Tries](https://awesome-repositories.com/f/software-engineering-architecture/trie-data-structures/x-fast-tries.md) — Provides X-Fast tries to perform rapid logarithmic-time successor and predecessor searches for integers.

### Scientific & Mathematical Computing

- [Shortest Path Algorithms](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/algorithms-and-complexity/algorithms/graph-processing/shortest-path-algorithms.md) — Provides high-performance shortest-path graph algorithms optimized with Fibonacci heaps.
- [Range Query Structures](https://awesome-repositories.com/f/scientific-mathematical-computing/range-query-structures.md) — Detects collisions and filters points across multiple dimensions using augmented trees and sparse arrays. ([source](https://github.com/Workiva/go-datastructures/blob/master/README.md))

### Part of an Awesome List

- [Data Structures](https://awesome-repositories.com/f/awesome-lists/data/data-structures.md) — Performant, thread-safe data structure collection.
