{"id":18828170,"url":"https://github.com/dinxsh/prustdb","last_synced_at":"2026-02-11T06:31:39.291Z","repository":{"id":255842094,"uuid":"853707403","full_name":"dinxsh/prustdb","owner":"dinxsh","description":"🦀 interact with a p2p key-value database through an API","archived":false,"fork":false,"pushed_at":"2024-12-23T23:13:08.000Z","size":24,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-09T13:45:17.619Z","etag":null,"topics":["database","key-value","peer-to-peer","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dinxsh.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-09-07T10:01:03.000Z","updated_at":"2024-12-30T09:25:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"646ad692-0dae-4375-a6c4-1c9aa37bd742","html_url":"https://github.com/dinxsh/prustdb","commit_stats":null,"previous_names":["dinxsh/prustdb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dinxsh/prustdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinxsh%2Fprustdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinxsh%2Fprustdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinxsh%2Fprustdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinxsh%2Fprustdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dinxsh","download_url":"https://codeload.github.com/dinxsh/prustdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinxsh%2Fprustdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29328261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"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":["database","key-value","peer-to-peer","rust"],"created_at":"2024-11-08T01:23:54.300Z","updated_at":"2026-02-11T06:31:39.277Z","avatar_url":"https://github.com/dinxsh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### prustDB\npeer-to-peer key-value database in rust \n\n![Rust](https://img.shields.io/badge/rust-%23000000.svg?style=for-the-badge\u0026logo=rust\u0026logoColor=white)\n![P2P](https://img.shields.io/badge/p2p-network-blue?style=for-the-badge)\n![Database](https://img.shields.io/badge/Database-KeyValue-green?style=for-the-badge)\n\n### Prerequisites\n\n- Rust (latest stable version)\n- Cargo (comes with Rust)\n- OpenSSL development libraries (for cryptography support)\n\n### Installation\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/dinxsh/prustdb.git\n   cd p2p_key_db\n   ```\n\n2. Build the project:\n   ```\n   cargo build --release\n   ```\n\n3. Run tests to ensure everything is working correctly:\n   ```\n   cargo test\n   ```\n\n### Usage\n\n1. Start a node:\n   ```\n   cargo run --release -- --port 8000 --data-dir /path/to/data\n   ```\n\n2. Connect to an existing network:\n   ```\n   cargo run --release -- --port 8001 --peer 127.0.0.1:8000 --data-dir /path/to/data\n   ```\n\n3. Use the API to interact with the database:\n   ```rust\n   use prustdb_client::Client;\n\n   async fn example() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n       let client = Client::connect(\"127.0.0.1:8000\").await?;\n       \n       // Set a value\n       client.set(\"key\", \"value\").await?;\n       \n       // Get a value\n       let value = client.get(\"key\").await?;\n       println!(\"Value: {:?}\", value);\n\n       Ok(())\n   }\n   ```\n\n### Architecture\n\nOur P2P Key-Value Database is built on a distributed hash table (DHT) architecture, similar to Kademlia. Here's a high-level overview:\n\n1. **Node Identification**: Each node in the network is assigned a unique ID using a cryptographically secure random number generator.\n\n2. **Key-Value Storage**: Data is stored as key-value pairs, distributed across the network based on the proximity of the key to node IDs.\n\n3. **Routing**: Nodes maintain a routing table of known peers, organized into k-buckets based on the XOR distance between node IDs.\n\n4. **Lookup Protocol**: To find a key, nodes perform iterative lookups, querying progressively closer nodes until the key is found or the closest nodes are reached.\n\n5. **Data Replication**: Key-value pairs are replicated across multiple nodes using a configurable replication factor to ensure data availability and fault tolerance.\n\n6. **Network Joining**: New nodes join the network by bootstrapping through a known peer, and then performing lookups for their ID to populate their routing table.\n\n7. **Load Balancing**: The DHT naturally distributes data and lookup load across the network, with additional active balancing mechanisms for hotspots.\n\n8. **Consistency**: We implement tunable consistency levels, from eventual consistency to strong consistency, allowing users to choose the appropriate trade-off between performance and consistency for their use case.\n\n9. **Caching**: An intelligent caching layer improves read performance for frequently accessed data.\n\n10. **Compression**: Data is compressed before storage and transmission to reduce storage requirements and network usage.\n\n### Performance\n\nPrustDB is designed for high performance:\n\n- Asynchronous I/O for efficient resource utilization\n- Custom memory allocator for reduced memory fragmentation\n- Bloom filters for rapid non-existence proofs\n- Optimized data structures for fast lookups and insertions\n- Benchmarking suite for continuous performance monitoring\n\n### Security\n\nSecurity is a top priority for PrustDB:\n\n- End-to-end encryption for all data transmissions\n- Authentication and authorization for all nodes and clients\n- Regular security audits and penetration testing\n- Sandboxing of untrusted code execution\n- Detailed security documentation and best practices\n\n### Contributing\n\nWe welcome contributions from the community! Please check out our [Contributing Guidelines](CONTRIBUTING.md) for details on how to get started, our code of conduct, and the process for submitting pull requests.\n\n### License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n### For the latest updates, follow us on [Twitter](https://twitter.com/dinescodes) and star our [GitHub repository](https://github.com/dinxsh/prustdb)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinxsh%2Fprustdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinxsh%2Fprustdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinxsh%2Fprustdb/lists"}