{"id":13439689,"url":"https://github.com/google/leveldb","last_synced_at":"2025-10-12T20:26:49.103Z","repository":{"id":20135582,"uuid":"23405758","full_name":"google/leveldb","owner":"google","description":"LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.","archived":false,"fork":false,"pushed_at":"2025-01-30T17:33:01.000Z","size":1672,"stargazers_count":38203,"open_issues_count":367,"forks_count":8063,"subscribers_count":1317,"default_branch":"main","last_synced_at":"2025-10-05T16:37:05.704Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-08-27T21:17:52.000Z","updated_at":"2025-10-05T15:52:39.000Z","dependencies_parsed_at":"2022-07-12T15:17:35.212Z","dependency_job_id":"89cd1cfe-bd4f-40da-a354-5d906a0ab775","html_url":"https://github.com/google/leveldb","commit_stats":{"total_commits":376,"total_committers":73,"mean_commits":"5.1506849315068495","dds":0.6861702127659575,"last_synced_commit":"068d5ee1a3ac40dabd00d211d5013af44be55bea"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/google/leveldb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fleveldb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fleveldb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fleveldb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fleveldb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/leveldb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fleveldb/sbom","scorecard":{"id":112873,"data":{"date":"2025-08-11","repo":{"name":"github.com/google/leveldb","commit":"ac691084fdc5546421a55b25e7653d450e5a25fb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.6,"checks":[{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/build.yml:9","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/google/leveldb/build.yml/main?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":10,"reason":"project is fuzzed","details":["Info: OSSFuzz integration found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/google/.github/SECURITY.md:1","Info: Found linked content: github.com/google/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/google/.github/SECURITY.md:1","Info: Found text in security policy: github.com/google/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T14:59:05.101Z","repository_id":20135582,"created_at":"2025-08-15T14:59:05.102Z","updated_at":"2025-08-15T14:59:05.102Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278647785,"owners_count":26021756,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-07-31T03:01:16.280Z","updated_at":"2025-10-12T20:26:49.085Z","avatar_url":"https://github.com/google.png","language":"C++","readme":"LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.\n\n\u003e **This repository is receiving very limited maintenance. We will only review the following types of changes.**\n\u003e\n\u003e * Fixes for critical bugs, such as data loss or memory corruption\n\u003e * Changes absolutely needed by internally supported leveldb clients. These typically fix breakage introduced by a language/standard library/OS update\n\n[![ci](https://github.com/google/leveldb/actions/workflows/build.yml/badge.svg)](https://github.com/google/leveldb/actions/workflows/build.yml)\n\nAuthors: Sanjay Ghemawat (sanjay@google.com) and Jeff Dean (jeff@google.com)\n\n# Features\n\n  * Keys and values are arbitrary byte arrays.\n  * Data is stored sorted by key.\n  * Callers can provide a custom comparison function to override the sort order.\n  * The basic operations are `Put(key,value)`, `Get(key)`, `Delete(key)`.\n  * Multiple changes can be made in one atomic batch.\n  * Users can create a transient snapshot to get a consistent view of data.\n  * Forward and backward iteration is supported over the data.\n  * Data is automatically compressed using the [Snappy compression library](https://google.github.io/snappy/), but [Zstd compression](https://facebook.github.io/zstd/) is also supported.\n  * External activity (file system operations etc.) is relayed through a virtual interface so users can customize the operating system interactions.\n\n# Documentation\n\n  [LevelDB library documentation](https://github.com/google/leveldb/blob/main/doc/index.md) is online and bundled with the source code.\n\n# Limitations\n\n  * This is not a SQL database.  It does not have a relational data model, it does not support SQL queries, and it has no support for indexes.\n  * Only a single process (possibly multi-threaded) can access a particular database at a time.\n  * There is no client-server support builtin to the library.  An application that needs such support will have to wrap their own server around the library.\n\n# Getting the Source\n\n```bash\ngit clone --recurse-submodules https://github.com/google/leveldb.git\n```\n\n# Building\n\nThis project supports [CMake](https://cmake.org/) out of the box.\n\n### Build for POSIX\n\nQuick start:\n\n```bash\nmkdir -p build \u0026\u0026 cd build\ncmake -DCMAKE_BUILD_TYPE=Release .. \u0026\u0026 cmake --build .\n```\n\n### Building for Windows\n\nFirst generate the Visual Studio 2017 project/solution files:\n\n```cmd\nmkdir build\ncd build\ncmake -G \"Visual Studio 15\" ..\n```\nThe default default will build for x86. For 64-bit run:\n\n```cmd\ncmake -G \"Visual Studio 15 Win64\" ..\n```\n\nTo compile the Windows solution from the command-line:\n\n```cmd\ndevenv /build Debug leveldb.sln\n```\n\nor open leveldb.sln in Visual Studio and build from within.\n\nPlease see the CMake documentation and `CMakeLists.txt` for more advanced usage.\n\n# Contributing to the leveldb Project\n\n\u003e **This repository is receiving very limited maintenance. We will only review the following types of changes.**\n\u003e\n\u003e * Bug fixes\n\u003e * Changes absolutely needed by internally supported leveldb clients. These typically fix breakage introduced by a language/standard library/OS update\n\nThe leveldb project welcomes contributions. leveldb's primary goal is to be\na reliable and fast key/value store. Changes that are in line with the\nfeatures/limitations outlined above, and meet the requirements below,\nwill be considered.\n\nContribution requirements:\n\n1. **Tested platforms only**. We _generally_ will only accept changes for\n   platforms that are compiled and tested. This means POSIX (for Linux and\n   macOS) or Windows. Very small changes will sometimes be accepted, but\n   consider that more of an exception than the rule.\n\n2. **Stable API**. We strive very hard to maintain a stable API. Changes that\n   require changes for projects using leveldb _might_ be rejected without\n   sufficient benefit to the project.\n\n3. **Tests**: All changes must be accompanied by a new (or changed) test, or\n   a sufficient explanation as to why a new (or changed) test is not required.\n\n4. **Consistent Style**: This project conforms to the\n   [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html).\n   To ensure your changes are properly formatted please run:\n\n   ```\n   clang-format -i --style=file \u003cfile\u003e\n   ```\n\nWe are unlikely to accept contributions to the build configuration files, such\nas `CMakeLists.txt`. We are focused on maintaining a build configuration that\nallows us to test that the project works in a few supported configurations\ninside Google. We are not currently interested in supporting other requirements,\nsuch as different operating systems, compilers, or build systems.\n\n## Submitting a Pull Request\n\nBefore any pull request will be accepted the author must first sign a\nContributor License Agreement (CLA) at https://cla.developers.google.com/.\n\nIn order to keep the commit timeline linear\n[squash](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Squashing-Commits)\nyour changes down to a single commit and [rebase](https://git-scm.com/docs/git-rebase)\non google/leveldb/main. This keeps the commit timeline linear and more easily sync'ed\nwith the internal repository at Google. More information at GitHub's\n[About Git rebase](https://help.github.com/articles/about-git-rebase/) page.\n\n# Performance\n\nHere is a performance report (with explanations) from the run of the\nincluded db_bench program.  The results are somewhat noisy, but should\nbe enough to get a ballpark performance estimate.\n\n## Setup\n\nWe use a database with a million entries.  Each entry has a 16 byte\nkey, and a 100 byte value.  Values used by the benchmark compress to\nabout half their original size.\n\n    LevelDB:    version 1.1\n    Date:       Sun May  1 12:11:26 2011\n    CPU:        4 x Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz\n    CPUCache:   4096 KB\n    Keys:       16 bytes each\n    Values:     100 bytes each (50 bytes after compression)\n    Entries:    1000000\n    Raw Size:   110.6 MB (estimated)\n    File Size:  62.9 MB (estimated)\n\n## Write performance\n\nThe \"fill\" benchmarks create a brand new database, in either\nsequential, or random order.  The \"fillsync\" benchmark flushes data\nfrom the operating system to the disk after every operation; the other\nwrite operations leave the data sitting in the operating system buffer\ncache for a while.  The \"overwrite\" benchmark does random writes that\nupdate existing keys in the database.\n\n    fillseq      :       1.765 micros/op;   62.7 MB/s\n    fillsync     :     268.409 micros/op;    0.4 MB/s (10000 ops)\n    fillrandom   :       2.460 micros/op;   45.0 MB/s\n    overwrite    :       2.380 micros/op;   46.5 MB/s\n\nEach \"op\" above corresponds to a write of a single key/value pair.\nI.e., a random write benchmark goes at approximately 400,000 writes per second.\n\nEach \"fillsync\" operation costs much less (0.3 millisecond)\nthan a disk seek (typically 10 milliseconds).  We suspect that this is\nbecause the hard disk itself is buffering the update in its memory and\nresponding before the data has been written to the platter.  This may\nor may not be safe based on whether or not the hard disk has enough\npower to save its memory in the event of a power failure.\n\n## Read performance\n\nWe list the performance of reading sequentially in both the forward\nand reverse direction, and also the performance of a random lookup.\nNote that the database created by the benchmark is quite small.\nTherefore the report characterizes the performance of leveldb when the\nworking set fits in memory.  The cost of reading a piece of data that\nis not present in the operating system buffer cache will be dominated\nby the one or two disk seeks needed to fetch the data from disk.\nWrite performance will be mostly unaffected by whether or not the\nworking set fits in memory.\n\n    readrandom  : 16.677 micros/op;  (approximately 60,000 reads per second)\n    readseq     :  0.476 micros/op;  232.3 MB/s\n    readreverse :  0.724 micros/op;  152.9 MB/s\n\nLevelDB compacts its underlying storage data in the background to\nimprove read performance.  The results listed above were done\nimmediately after a lot of random writes.  The results after\ncompactions (which are usually triggered automatically) are better.\n\n    readrandom  : 11.602 micros/op;  (approximately 85,000 reads per second)\n    readseq     :  0.423 micros/op;  261.8 MB/s\n    readreverse :  0.663 micros/op;  166.9 MB/s\n\nSome of the high cost of reads comes from repeated decompression of blocks\nread from disk.  If we supply enough cache to the leveldb so it can hold the\nuncompressed blocks in memory, the read performance improves again:\n\n    readrandom  : 9.775 micros/op;  (approximately 100,000 reads per second before compaction)\n    readrandom  : 5.215 micros/op;  (approximately 190,000 reads per second after compaction)\n\n## Repository contents\n\nSee [doc/index.md](doc/index.md) for more explanation. See\n[doc/impl.md](doc/impl.md) for a brief overview of the implementation.\n\nThe public interface is in include/leveldb/*.h.  Callers should not include or\nrely on the details of any other header files in this package.  Those\ninternal APIs may be changed without warning.\n\nGuide to header files:\n\n* **include/leveldb/db.h**: Main interface to the DB: Start here.\n\n* **include/leveldb/options.h**: Control over the behavior of an entire database,\nand also control over the behavior of individual reads and writes.\n\n* **include/leveldb/comparator.h**: Abstraction for user-specified comparison function.\nIf you want just bytewise comparison of keys, you can use the default\ncomparator, but clients can write their own comparator implementations if they\nwant custom ordering (e.g. to handle different character encodings, etc.).\n\n* **include/leveldb/iterator.h**: Interface for iterating over data. You can get\nan iterator from a DB object.\n\n* **include/leveldb/write_batch.h**: Interface for atomically applying multiple\nupdates to a database.\n\n* **include/leveldb/slice.h**: A simple module for maintaining a pointer and a\nlength into some other byte array.\n\n* **include/leveldb/status.h**: Status is returned from many of the public interfaces\nand is used to report success and various kinds of errors.\n\n* **include/leveldb/env.h**:\nAbstraction of the OS environment.  A posix implementation of this interface is\nin util/env_posix.cc.\n\n* **include/leveldb/table.h, include/leveldb/table_builder.h**: Lower-level modules that most\nclients probably won't use directly.\n","funding_links":[],"categories":["Database","HarmonyOS","C++","Databases","NoSQL","Package (computing)","C++ (70)","Stores","Embedded Databases","Uncategorized","Real-World Projects","数据库管理系统","数据库","On-Prem","\u003ca name=\"C%2B%2B\"\u003e\u003c/a\u003eC++"],"sub_categories":["Windows Manager","Key-Value Databases","[`leveldown`][leveldown]","Uncategorized","Data Processing \u0026 Storage","网络服务_其他","In Memory Database"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fleveldb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fleveldb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fleveldb/lists"}