{"id":18467161,"url":"https://github.com/draganm/blobmap","last_synced_at":"2025-05-05T16:33:56.977Z","repository":{"id":255470260,"uuid":"851843694","full_name":"draganm/blobmap","owner":"draganm","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-12T14:21:22.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T17:56:23.050Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/draganm.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-03T19:42:05.000Z","updated_at":"2024-12-12T14:21:03.000Z","dependencies_parsed_at":"2024-09-05T15:45:42.402Z","dependency_job_id":"50d5086f-28ca-46e0-bd7f-e5ed3e569697","html_url":"https://github.com/draganm/blobmap","commit_stats":null,"previous_names":["draganm/blobmap"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draganm%2Fblobmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draganm%2Fblobmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draganm%2Fblobmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draganm%2Fblobmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/draganm","download_url":"https://codeload.github.com/draganm/blobmap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252533812,"owners_count":21763659,"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":[],"created_at":"2024-11-06T09:19:04.992Z","updated_at":"2025-05-05T16:33:56.926Z","avatar_url":"https://github.com/draganm.png","language":"Go","readme":"# Blobmap\n\n**Blobmap** is a specialized data structure for efficient storage and retrieval of Binary Large Objects (Blobs) within a continuous keyspace of 64-bit unsigned integers (`uint64`). The keyspace begins at a specified value `n` and spans `m` consecutive keys, covering the range from `n` to `n + m - 1`.\n\nThe data is stored in a read-only memory-mapped file to enable constant-time (`O(1)`) access, making it scalable for handling large datasets.\n\n## File Format\n\n### Structure Overview\n\n#### 1. Header\nThe file begins with a header containing metadata critical for blob management:\n- **Number of blobs**: The total count of blobs in the file.\n- **Key offset**: The starting key `n` for the keyspace.\n\n#### 2. Offset Table\nAn array of **offset records** follows the header. Each record stores the **end offset** of a blob, encoded as a 64-bit big-endian integer. The start of each blob is implicitly defined by the end offset of the preceding blob.\n\n#### 3. Blob Data\nThe blobs themselves are stored sequentially in the file. The data for each blob can be accessed by determining its byte range from the offset records.\n\n#### 4. Integrity Check\nThe file concludes with an [xxHash](https://xxhash.com/) checksum, covering all preceding data. This can be used to verify the integrity of the **blobmap** during reads.\n\n## Example Layout\n\n```\n+----------------+----------------------+-------------------+-------------+\n|     Header     |    Offset Table      |    Blob Data      |   xxHash    |\n+----------------+----------------------+-------------------+-------------+\n| Num of Blobs   | End Offset of Blob 1 | Blob 1 Data Bytes | Hash Value  |\n| Key Offset (n) | End Offset of Blob 2 | Blob 2 Data Bytes |             |\n|                | End Offset of Blob 3 | Blob 3 Data Bytes |             |\n+----------------+----------------------+-------------------+-------------+\n```\n\n- **Header**: Stores the number of blobs and the starting key.\n- **Offset Table**: Defines the end offsets of each blob.\n- **Blob Data**: Contains the actual binary data of each blob, laid out sequentially.\n- **xxHash**: Provides a checksum to ensure data integrity.\n\n### Blob Access\nTo access a specific blob, compute its byte range using the corresponding offsets in the table:\n- The start of blob `i` is the end offset of blob `i-1` (or immediately after the offset table for the first blob).\n- The end of blob `i` is the offset at position `i` in the table.\n\nThis layout enables fast, direct access to any blob, minimizing overhead and maximizing scalability for large datasets.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdraganm%2Fblobmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdraganm%2Fblobmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdraganm%2Fblobmap/lists"}