{"id":28385999,"url":"https://github.com/unum-cloud/ucset","last_synced_at":"2025-07-18T19:03:49.258Z","repository":{"id":61746195,"uuid":"549831226","full_name":"unum-cloud/ucset","owner":"unum-cloud","description":"If only std::set was a DBMS: collection of templated ACID in-memory exception-free thread-safe and concurrent containers in a header-only library","archived":false,"fork":false,"pushed_at":"2023-04-23T23:46:26.000Z","size":191,"stargazers_count":40,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-07-09T00:55:32.556Z","etag":null,"topics":["acid","binary-search-tree","binary-tree","concurrency","cpp","in-memory","in-memory-database","lock-free","metaprogramming","transactional-memory"],"latest_commit_sha":null,"homepage":"https://unum-cloud.github.io/ucset/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unum-cloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-11T20:05:14.000Z","updated_at":"2025-05-07T05:42:52.000Z","dependencies_parsed_at":"2023-02-17T21:15:36.136Z","dependency_job_id":null,"html_url":"https://github.com/unum-cloud/ucset","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/unum-cloud/ucset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unum-cloud%2Fucset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unum-cloud%2Fucset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unum-cloud%2Fucset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unum-cloud%2Fucset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unum-cloud","download_url":"https://codeload.github.com/unum-cloud/ucset/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unum-cloud%2Fucset/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265815115,"owners_count":23832840,"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":["acid","binary-search-tree","binary-tree","concurrency","cpp","in-memory","in-memory-database","lock-free","metaprogramming","transactional-memory"],"created_at":"2025-05-30T12:38:12.592Z","updated_at":"2025-07-18T19:03:49.245Z","avatar_url":"https://github.com/unum-cloud.png","language":"C++","readme":"\u003ch1 align=\"center\"\u003eUnexceptionally Consistent Set\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003e\nImagine In-Memory Templated Containers\u003cbr/\u003e\nBeing as Consistent as Databases\u003cbr/\u003e\n\u003c/h3\u003e\n\u003cbr/\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://discord.gg/njybmcBEay\"\u003e\u003cimg height=\"25\" src=\"https://github.com/unum-cloud/ukv/raw/main/assets/icons/discord.svg\" alt=\"Discord\"\u003e\u003c/a\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u003ca href=\"https://www.linkedin.com/company/unum-cloud/\"\u003e\u003cimg height=\"25\" src=\"https://github.com/unum-cloud/ukv/raw/main/assets/icons/linkedin.svg\" alt=\"LinkedIn\"\u003e\u003c/a\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u003ca href=\"https://twitter.com/unum_cloud\"\u003e\u003cimg height=\"25\" src=\"https://github.com/unum-cloud/ukv/raw/main/assets/icons/twitter.svg\" alt=\"Twitter\"\u003e\u003c/a\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u003ca href=\"https://unum.cloud/post\"\u003e\u003cimg height=\"25\" src=\"https://github.com/unum-cloud/ukv/raw/main/assets/icons/blog.svg\" alt=\"Blog\"\u003e\u003c/a\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u003ca href=\"https://github.com/unum-cloud/ucset\"\u003e\u003cimg height=\"25\" src=\"https://github.com/unum-cloud/ukv/raw/main/assets/icons/github.svg\" alt=\"GitHub\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nUCSet library provides `std::set`-like class templates for C++, where every operation is `noexcept`, and no update can leave the container in a partial state.\n\nThere are 3 containers to choose from:\n\n- [`consistent_set`][consistent_set]: serializable consistency, fully sorted, based on [`std::set`][stl-set].\n- [`consistent_avl`][consistent_avl]: serializable consistency, fully sorted, based on [AVL trees][avl].\n- [`versioning_avl`][versioning_avl]: [snapshot isolation][snapshot] via [MVCC][mvcc], fully sorted, based on [AVL trees][avl].\n\nAll of them:\n\n- are `noexcept` top to bottom!\n- are templated, to be used with any `noexcept`-movable and `default`-constructible types.\n- can be wrapped into [`locked_gt`][locked], to make them thread-safe.\n- can be wrapped into [`partitioned_gt`][partitioned], to make them concurrent.\n\nIf you want your exceptions and classical interfaces back, you can also wrap any container into [`crazy_gt`][crazy].\n\n## Installation\n\nThe entire library is header-only and requires C++17.\nYou can copy-paste it, but it is not 2022 anymore.\nWe suggest using CMake:\n\n```cmake\ninclude(FetchContent)\nFetchContent_Declare(\n    ucset\n    GIT_REPOSITORY https://github.com/unum-cloud/ucset\n    GIT_TAG main\n    CONFIGURE_COMMAND \"\" # Nothing to configure, its that simple :)\n    BUILD_COMMAND \"\" # No build needed, UCSet is header-only\n)\nFetchContent_MakeAvailable(ucset)\ninclude_directories(${consistent_set_SOURCE_DIR})\n```\n\n## Why we created this?\n\nHate for [`std::bad_alloc`](https://en.cppreference.com/w/cpp/memory/new/bad_alloc).\nIf you consider \"Out of Memory\" an exception, you are always underutilizing your system.\nIt happened way too many times that a program crashed when I was only getting to an exciting place.\nEspecially with:\n\n- [Neo4J][neo4j] and every other JVM-based project.\n- With big batch sizes beyond VRAM sizes of GPU when doing ML.\n\nAt Unum, we live in conditions where machines can easily have 1 TB of RAM per CPU socket, but it is still at least 100x less than the datasets we are trying to swallow.\n\n![UKV Landscape](https://github.com/unum-cloud/ukv/raw/main/assets/charts/Intro.png)\n\nSo when we started working on [UKV][ukv] to build high-speed hardware-friendly databases, we needed something better than Standard Templates Library, with features uncommon to other libraries as well:\n\n- Accessing the **allocator state** by reference.\n- **Reserving** memory for tree nodes before inserting.\n- Explicitly traversing trees for **random sampling**.\n- **Speed**!\n\nNow UCSet powers the in-memory backend of UKV.\n\n## Performance Tuning\n\nConcurrent containers in the library are blocking.\nTheir performance greatly depends on the \"mutexes\" you are using.\nSo we allow different implementations:\n\n- STL: [`std::shared_mutex`][stl-shared_mutex],\n- Intel One API: [`tbb::rw_mutex`][tbb],\n- Or anything else with the same interfaces.\n\n\n[stl-set]: https://en.cppreference.com/w/cpp/container/set\n[stl-shared_mutex]: https://en.cppreference.com/w/cpp/thread/shared_mutex\n[avl]: https://en.wikipedia.org/wiki/AVL_tree\n[tbb]: https://spec.oneapi.io/versions/latest/elements/oneTBB/source/named_requirements/mutexes/rw_mutex.html#readerwritermutex\n[dbms]: https://en.wikipedia.org/wiki/Database\n[mvcc]: https://en.wikipedia.org/wiki/Multiversion_concurrency_control\n[neo4j]: http://neo4j.com\n[snapshot]: https://jepsen.io/consistency/models/snapshot-isolation\n\n[ukv]: https://github.com/unum-cloud/ukv\n[consistent_set]: tree/main/include/ucset/consistent_set.hpp\n[consistent_avl]: tree/main/include/ucset/consistent_avl.hpp\n[versioning_avl]: tree/main/include/ucset/versioning_avl.hpp\n[locked]: tree/main/include/ucset/locked.hpp\n[partitioned]: tree/main/include/ucset/partitioned.hpp\n[crazy]: tree/main/include/ucset/crazy.hpp\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funum-cloud%2Fucset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funum-cloud%2Fucset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funum-cloud%2Fucset/lists"}