{"id":13409227,"url":"https://github.com/spullara/nbd","last_synced_at":"2025-05-06T20:08:34.576Z","repository":{"id":22747950,"uuid":"26093248","full_name":"spullara/nbd","owner":"spullara","description":"NDB server","archived":false,"fork":false,"pushed_at":"2024-05-31T20:07:34.000Z","size":43,"stargazers_count":66,"open_issues_count":2,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-31T02:23:13.055Z","etag":null,"topics":["foundationdb","java","nbd","nbd-client","storage-service","volume"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spullara.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":"2014-11-02T21:06:50.000Z","updated_at":"2024-12-12T09:33:00.000Z","dependencies_parsed_at":"2024-10-27T00:58:03.792Z","dependency_job_id":null,"html_url":"https://github.com/spullara/nbd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spullara%2Fnbd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spullara%2Fnbd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spullara%2Fnbd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spullara%2Fnbd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spullara","download_url":"https://codeload.github.com/spullara/nbd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252761192,"owners_count":21800124,"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":["foundationdb","java","nbd","nbd-client","storage-service","volume"],"created_at":"2024-07-30T20:00:59.063Z","updated_at":"2025-05-06T20:08:34.557Z","avatar_url":"https://github.com/spullara.png","language":"Java","readme":"License\n=======\n\nCopyright 2018 Sam Pullara\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\nNetwork Block Device\n====================\n\nThe nbd-client on Linux allows you to mount a remote server implementing the NBD protocol\nas a local block device. This NBDServer exports volumes whose data is stored in\nFoundationDB. This gives you a highly scalable, high performance, reliable block device that\nyou can then format and put a filesystem on it.\n\nThe NBDCLI command allows you to create new volume, list the volumes you have in your system,\ndelete a volume or snapshot a current volume to another volume.\n\nHOWTO\n=====\n\nBring up FoundationDB and then run the NBDServer. It will be listening on the default 10809 port.\n\n```bash\njava -jar nbdcli.jar server\n```\n\nCreate a new 1G volume:\n\n```bash\njava -jar nbdcli.jar create -n [volume name] -s 1G \n```\n\nOn a Linux host, install ndb, create the block device, format it and mount it:\n\n```bash\nsudo apt-get update \u0026\u0026 apt-get install nbd\nsudo modprobe nbd\nsudo nbd-client -N [volume name] [host] /dev/nbd0\nsudo mkfs.xfs /dev/nbd0\nmkdir tmp\nsudo mount /dev/nbd0 tmp\n```\n\nYou may need to change the ownership on that directory to access it but you can now save files\nthere and they will be backed by FoundationDB. Each volume can only be shared to a single nbd client\nat a time. \n\nUnder the covers\n================\n\nEach volume is a sparse array of bytes (FDBArray) stored in FoundationDB across many rows in the database. In addition\neach volume can have a parent whose sparse array shows through where the child volume hasn't written yet. Here is the\ninterface that we implement:\n\n```java\npublic interface Storage {\n  void connect();\n\n  void disconnect();\n\n  CompletableFuture\u003cVoid\u003e read(byte[] buffer, long offset);\n\n  CompletableFuture\u003cVoid\u003e write(byte[] buffer, long offset);\n\n  CompletableFuture\u003cVoid\u003e flush();\n\n  long size();\n\n  long usage();\n}\n```\n","funding_links":[],"categories":["Layers"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspullara%2Fnbd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspullara%2Fnbd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspullara%2Fnbd/lists"}