LevelDB is a high-performance, embedded key-value storage library written in C++. It implements a Log-Structured Merge-Tree (LSM) architecture, organizing data into sorted tables across multiple levels to optimize write throughput and read latency. The codebase provides a stable C++ API with a C wrapper, supporting atomic batch operations, transient snapshots, and forward/backward iteration. It is designed for single-process access with no builtin client-server support, making it ideal for embedded use cases where low-latency access and crash recovery are critical. The architecture is monolithic, consisting of core database logic in the `db/` directory, table management in `table/`, and utility functions in `util/`. Platform abstraction is handled via the `port/` directory, isolating OS-specific file and thread operations. The library relies on external dependencies for compression (Snappy, Zstd) and testing (GTest), managed via CMake and submodules. It emphasizes durability through Write-Ahead Logging (WAL) and robust recovery mechanisms that validate manifests and replay logs on startup. While the codebase demonstrates exceptional craftsmanship in concurrency control and data structures, it is receiving very limited maintenance, accepting only critical bug fixes. The repository requires C++17 and CMake 3.22, which may limit compatibility with older toolchains. The C API requires careful ABI management, and platform-specific implementations in `util/env_posix.cc` and `util/env_windows.cc` risk divergence over time.
lockfree is a header-only C++11 library providing lock-free data structures for concurrent programming. It offers both single-producer single-consumer (SPSC) and multi-producer multi-consumer (MPMC) variants of queues, ring buffers, bipartite buffers, and priority queues. The library is designed for use across a wide spectrum of systems from deeply embedded to HPC, featuring no dynamic allocation and optimized for high performance. Architecture-wise, it's organized into spsc/ and mpmc/ namespaces with each data structure having separate header and implementation files, aggregated through lockfree.hpp. The implementation uses atomic operations and clever algorithms to achieve lock-free behavior without mutexes.