{"id":45821035,"url":"https://github.com/broxus/cassadilia","last_synced_at":"2026-02-26T20:41:53.432Z","repository":{"id":290552958,"uuid":"974829484","full_name":"broxus/cassadilia","owner":"broxus","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-15T13:48:28.000Z","size":152,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-20T17:52:53.078Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/broxus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-29T11:21:04.000Z","updated_at":"2025-12-15T13:47:45.000Z","dependencies_parsed_at":"2025-04-29T12:36:39.496Z","dependency_job_id":"8d1cb7aa-ebdd-4c7f-904a-51d7c353ab88","html_url":"https://github.com/broxus/cassadilia","commit_stats":null,"previous_names":["0xdeafbeef/cassadilia","broxus/cassadilia"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/broxus/cassadilia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Fcassadilia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Fcassadilia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Fcassadilia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Fcassadilia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/broxus","download_url":"https://codeload.github.com/broxus/cassadilia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Fcassadilia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29872441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T18:42:30.764Z","status":"ssl_error","status_checked_at":"2026-02-26T18:41:47.936Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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-02-26T20:41:49.810Z","updated_at":"2026-02-26T20:41:53.423Z","avatar_url":"https://github.com/broxus.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## When to use this?\n\n- You want to store blobs. Blobs are huge files, like 10mb+.\n- You will have read-mostly access pattern.\n- You want get_range(from, to) functionality.\n- You want 0 write amplification. You will have exactly one 1 write per blob\n  without compactions and all of this stuff.\n- You tried to use rocksdb for this, and it killed your disk and brain :)\n\n## When not to use this?\n\n- Lots of small files. Lsm tree is still a king here.\n- You use something not unix-like.\n\n## Architecture principles\n\n- Firstly store data in cas, then index it. With this approach you don't need\n  to handle consistency errors in the user code. You can get list of orphaned\n  blobs on startup and do something with them.\n  As user, you can do nothing if you have a record in the index for blob, but no\n  actual blob in cas.\n  Hi mr. rocksdb :)\n\n- Blobs are stored in a classic cas manner /h/a/s/h.\n- Hash is blake3\n- Index is stored in a single file. Which is periodically rewritten on wal\n  roll-over.\n- Internally index is a BtreeMap.\n\n## Concurrency and Locking\n\nCassadilia relies on deterministic blob paths and scoped intents to stay\nconsistent.\n\n### 1. Atomic CAS commits\n\n- Parent directories are created opportunistically; repeated calls are safe.\n- Staged files are atomically renamed into place. If the CAS file already\n  exists, the staging file is dropped without touching the existing blob.\n- Concurrent commits of the same hash converge on a single CAS file. Later\n  writers drop their staging files without touching the existing blob.\n\n### 2. Intent Tracking System\n\nWe use scoped intents to prevent races between concurrent puts and deletes.\n\n- Register intent: record `key -\u003e blob_hash` in `pending_intents` map; no\n  refcount changes.\n- Commit: append WAL Put, apply it to the index updating refcounts, remove the\n  intent, compute unreferenced blobs, exclude hashes still referenced by active\n  intents, delete the rest.\n- Drop without commit: remove the current intent and restore any previously\n  replaced intent; no refcount changes.\n- Remove ops: append WAL Remove, apply to state, filter unreferenced blobs\n  against active intents, delete before doing checkpoint.\n\nIntents are in-memory only; if a process exits before commit, any staged files\nbecome orphans, handled by startup orphan scanning.\n\n## Todo\n\n- [x] Gather orphaned blobs on startup.\n- [x] Allow to check blobs integrity.\n- [ ] Cache fd-s\n- [ ] Use mmap or allow to configure read mode\n- [x] Lock index file to disallow concurrent db open\n- [x] Save settings in the separate file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroxus%2Fcassadilia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbroxus%2Fcassadilia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroxus%2Fcassadilia/lists"}