{"id":13759351,"url":"https://github.com/radareorg/sdb","last_synced_at":"2026-01-16T11:12:20.632Z","repository":{"id":4524996,"uuid":"5665061","full_name":"radareorg/sdb","owner":"radareorg","description":"Simple and fast string based key-value database with support for arrays and json","archived":false,"fork":false,"pushed_at":"2025-12-19T11:32:52.000Z","size":2359,"stargazers_count":225,"open_issues_count":31,"forks_count":62,"subscribers_count":13,"default_branch":"master","last_synced_at":"2026-01-13T21:22:51.115Z","etag":null,"topics":["c","data-structures","database","hacktoberfest","hashtable","key-value"],"latest_commit_sha":null,"homepage":"https://www.radare.org/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/radareorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":null,"patreon":null,"open_collective":"radareorg","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2012-09-03T23:15:15.000Z","updated_at":"2025-12-19T11:32:48.000Z","dependencies_parsed_at":"2025-12-17T04:05:11.133Z","dependency_job_id":null,"html_url":"https://github.com/radareorg/sdb","commit_stats":{"total_commits":1357,"total_committers":55,"mean_commits":"24.672727272727272","dds":0.1717022844509949,"last_synced_commit":"195f11cde6ebca7f712bebf81354ed72c2e8e1d6"},"previous_names":["radare/sdb"],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/radareorg/sdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radareorg%2Fsdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radareorg%2Fsdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radareorg%2Fsdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radareorg%2Fsdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/radareorg","download_url":"https://codeload.github.com/radareorg/sdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radareorg%2Fsdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["c","data-structures","database","hacktoberfest","hashtable","key-value"],"created_at":"2024-08-03T13:00:51.339Z","updated_at":"2026-01-16T11:12:20.614Z","avatar_url":"https://github.com/radareorg.png","language":"C","funding_links":["https://opencollective.com/radareorg"],"categories":["C"],"sub_categories":[],"readme":"SDB (string database)\n=====================\n\nsdb is a simple string key/value database based on djb's cdb\ndisk storage and supports JSON and arrays introspection.\n\nmcsdbd is a memcache server with disk storage based on sdb.\nIt is distributed as a standalone binary and a library.\n\nThere's also the sdbtypes: a vala library that implements\nseveral data structures on top of an sdb or a memcache instance.\n\n[![GHA](https://github.com/radareorg/sdb/workflows/ci/badge.svg)](https://github.com/radareorg/sdb/actions?query=workflow%3Aci)\n[![COV](https://scan.coverity.com/projects/1651/badge.svg)](https://scan.coverity.com/projects/1651)\n\nAuthor\n------\npancake \u003cpancake@nopcode.org\u003e\n\nContains\n--------\n* namespaces (multiple sdb paths)\n* atomic database sync (never corrupted)\n* bindings for vala, luvit, newlisp and nodejs\n* command-line frontend for sdb databases\n* memcache client and server with sdb backend\n* arrays support (syntax sugar)\n* json parser/getter (js0n.c)\n\nRips\n----\n* disk storage based on cdb code\n* linked lists from r2 api\n\nCompilation\n-----------\nFor native builds just type `make`. Everything will be compiled twice to get the .dylib and .a and sdb in PIC and nonPIC modes.\n\nTo compile with Emscripten for Javascript:\n\n\tmake CC=emcc EXT_EXE=.js\n\nTo crosscompile with meson:\n\n```\n$ cat \u003e cross-file.txt \u003c\u003cEOF\n[properties]\nexe_wrapper = 'wine'\nand then run meson build --cross-file cross-file.txt ; ninja -C build. It should work and it should create another binary called sdb_native.\nEOF\n$ meson build --cross-file cross-file.txt\n$ ninja -C build\n```\n\nChanges\n-------\nI have modified cdb code a little to create smaller databases and\nbe memory leak free in order to use it from a library.\n\nThe sdb's cdb database format is 10% smaller than the original\none. This is because keylen and valuelen are encoded in 4 bytes:\n1 for the key length and 3 for the value length.\n\nIn a test case, a 4.3MB cdb database takes only 3.9MB after this\nfile format change.\n\nUsage example\n-------------\nLet's create a database!\n\n```\n$ sdb d hello=world\n$ sdb d hello\nworld\n```\n\nUsing arrays (\u003e=0.6):\n\n```\n$ sdb - '[]list=1,2' '[0]list' '[0]list=foo' '[]list' '[+1]list=bar'\n1\nfoo\n2\n```\n\nLet's play with json:\n\n```\n$ sdb d g='{\"foo\":1,\"bar\":{\"cow\":3}}'\n$ sdb d g:bar.cow\n3\n$ sdb - user='{\"id\":123}' user:id=99 user:id\n99\n```\n\nUsing the command-line without any disk database:\n\n```\n$ sdb - foo=bar foo a=3 +a -a\nbar\n4\n3\n\n$ sdb -\nfoo=bar\nfoo\nbar\na=3\n+a\n4\n-a\n3\n```\n\nRemove the database\n\n```\n$ rm -f d\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradareorg%2Fsdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fradareorg%2Fsdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradareorg%2Fsdb/lists"}