{"id":37195497,"url":"https://github.com/replit/rdb","last_synced_at":"2026-01-14T22:43:58.625Z","repository":{"id":57630598,"uuid":"408564947","full_name":"replit/rdb","owner":"replit","description":"Redis RDB File Parser","archived":true,"fork":true,"pushed_at":"2021-09-20T20:00:20.000Z","size":238,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-20T06:35:37.666Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"matthewjhe/rdb","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/replit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-20T18:54:04.000Z","updated_at":"2025-02-10T21:29:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/replit/rdb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/replit/rdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Frdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Frdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Frdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Frdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/replit","download_url":"https://codeload.github.com/replit/rdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Frdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","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":[],"created_at":"2026-01-14T22:43:57.845Z","updated_at":"2026-01-14T22:43:58.612Z","avatar_url":"https://github.com/replit.png","language":"Go","readme":"# rdb [![Build Status](https://travis-ci.org/matthewjhe/rdb.svg?branch=master)](https://travis-ci.org/matthewjhe/rdb) [![GoDoc](https://godoc.org/github.com/matthewjhe/rdb?status.svg)](http://godoc.org/github.com/matthewjhe/rdb)\n\n**WARNING**: This project is not production ready.\n\nPackage rdb is a Redis RDB File parser written in [Go](https://golang.org/).\n\n## Feature\n\n- Concurrent parsing.\n- Built in memory report.\n- Simple filter support.\n- Layered skipping strategies.\n\n## Install\n\n`go get -u github.com/matthewjhe/rdb`\n\n## Usage\n\n### Basic Example\n\nThe basic use case is very simple, just implements Filter interface and pass it to Parse:\n\n```go\npackage main\n\nimport (\n    \"github.com/matthewjhe/rdb\"\n)\n\nfunc (f filter) Key(k rdb.Key) bool { return false }\nfunc (f filter) Type(t rdb.Type) bool   { return false }\nfunc (f filter) Database(db rdb.DB) bool { return false }\nfunc (f filter) Set(v *rdb.Set) { }\nfunc (f filter) List(v *rdb.List) { }\nfunc (f filter) Hash(v *rdb.Hash) { }\nfunc (f filter) String(v *rdb.String) { }\nfunc (f filter) SortedSet(v *rdb.SortedSet) { }\n\nfunc main() {\n    const file = \"/tmp/dump.rdb\"\n    reader, err := rdb.NewBufferReader(file, 0)\n    if err != nil {\n        panic(err)\n    }\n\n    if err := rdb.Parse(reader, rdb.WithFilter(filter{})); err != nil {\n        panic(err)\n    }\n}\n```\n\n### Skipping\n\n**NOTE**: RDB file is read sequentially, when we say skips a database, we also need to parse this database's every single key,\nwe just simply skips actions like `decompress`, `unzip ziplist`, etc. It is impossible to skips a `key` without reading its metadata.\n\n- Global Skip Strategy\n\nGlobal skip strategy applies to the whole parsing lifetime, it can be overwritten by Filter's `Database` method,\nit will be restored when parsing a database completely.\n\nGlobal skip strategy is set by a ParseOption when rdb.Parse is called:\n\n```go\n    // reads memory report only\n    strategy := rdb.WithStrategy(rdb.SkipExpiry | rdb.SkipMeta | rdb.SkipValue)\n    err := rdb.Parse(reader, strategy, rdb.WithFilter(filter{}))\n    // ...\n```\n\n- Database Skip Strategy\n\nDatabase skip strategy applies to a database lifetime, it is set by Filter's `Database` method, and it can be overwritten\nby Filter's `Key` or `Type` method. Database skip strategy is set to global skip strategy by default.\n\n```go\nfunc (f filter) Database(db rdb.DB) bool {\n    // skips this database\n    db.Skip(rdb.SkipAll)\n\n    // skips database's metadata and key's expiry\n    // db.Skip(rdb.SkipMeta | rdb.SkipExpiry)\n    return false\n}\n```\n\n- Type and Key Skip Strategy\n\nType and key skip strategy overwrite database skip strategy. It only applies the key and value which will read next.\n\n```go\nfunc (f filter) Type(t rdb.Type) bool {\n    // skips this type\n    t.Skip(rdb.SkipAll)\n    return false\n}\n\nfunc (f filter) Key(key rdb.Key) bool {\n    // skips this key\n    // key.Skip(rdb.SkipAll)\n\n    // skips value\n    key.Skip(rdb.SkipValue)\n    return false\n}\n```\n\n### Syncing\n\nBy default, rdb uses multiple goroutines to parse keys which would cause keys disorder.\nIf the order of keys is important, use `EnableSync` ParseOption.\n\n```go\n    rdb.Parse(reader, rdb.WithFilter(filter{}), rdb.EnableSync())\n```\n\n### Aborting\n\nSometimes we want to abort the parsing process, this can be done by return `true` when one of the following methods is called:\nNote that the abort action is taking effect immediately when the function returns.\n\n```go\nfunc (f filter) Key(k rdb.Key) bool {\n    return true\n}\nfunc (f filter) Type(t rdb.Type) bool   {\n    return true\n}\nfunc (f filter) Database(db rdb.DB) bool {\n    return true\n}\n```\n\n## References\n\n- [redis-rdb-tools](https://github.com/sripathikrishnan/redis-rdb-tools) for Redis RDB format and memory profile.\n\n## License\n\n[MIT](https://github.com/matthewjhe/rdb/blob/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplit%2Frdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freplit%2Frdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplit%2Frdb/lists"}