{"id":28373418,"url":"https://github.com/hash-anu/anudbbenchmark","last_synced_at":"2025-07-29T05:35:22.640Z","repository":{"id":290899128,"uuid":"975927294","full_name":"hash-anu/AnuDBBenchmark","owner":"hash-anu","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-08T07:23:16.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T10:36:31.022Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/hash-anu.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":"2025-05-01T06:49:20.000Z","updated_at":"2025-05-08T07:23:19.000Z","dependencies_parsed_at":"2025-05-01T07:46:52.245Z","dependency_job_id":null,"html_url":"https://github.com/hash-anu/AnuDBBenchmark","commit_stats":null,"previous_names":["hash-anu/anudbbenchmark"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hash-anu/AnuDBBenchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hash-anu%2FAnuDBBenchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hash-anu%2FAnuDBBenchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hash-anu%2FAnuDBBenchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hash-anu%2FAnuDBBenchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hash-anu","download_url":"https://codeload.github.com/hash-anu/AnuDBBenchmark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hash-anu%2FAnuDBBenchmark/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267633684,"owners_count":24118778,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-05-29T19:38:59.852Z","updated_at":"2025-07-29T05:35:22.633Z","avatar_url":"https://github.com/hash-anu.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 AnuDBBenchmark\nThis repository benchmarks the performance of [AnuDB](https://github.com/hash-anu/AnuDB), a custom storage engine designed for high-efficiency data operations, in comparison with SQLite3.\n\n\u003e⚠️ Disclaimer:\nThis benchmark focuses on specific workloads (insert, query, update, delete, and parallel operations using JSON documents) executed on embedded hardware (e.g., Raspberry Pi).It is not a general-purpose performance comparison.SQLite is a feature-rich, general-purpose SQL database optimized for reliability and transactional correctness across a wide range of use cases.AnuDB is a lightweight engine optimized for high-throughput workloads with a different design philosophy.Results may vary based on workload characteristics, hardware, and tuning parameters.\n---\n## 📊 Benchmark Results\n\nThe following table shows the performance metrics comparing AnuDB and SQLite3:\n\n| Database | Operation | Time(s) | Operations | Ops/s |\n|----------|-----------|---------|------------|-------|\n| AnuDB    | Insert    | 33.776  | 10000      | 296.068 |\n| AnuDB    | Query     | 29.09   | 1000       | 34.3761 |\n| AnuDB    | Update    | 17.176  | 5000       | 291.104 |\n| AnuDB    | Delete    | 7.306   | 2500       | 342.185 |\n| AnuDB    | Parallel  | 1429.33 | 10000      | 6.99629 |\n| SQLite3  | Insert    | 8.659   | 10000      | 1154.87 |\n| SQLite3  | Query     | 35.857  | 1000       | 27.8886 |\n| SQLite3  | Update    | 8.263   | 5000       | 605.107 |\n| SQLite3  | Delete    | 1.374   | 2500       | 1819.51 |\n| SQLite3  | Parallel  | 835.498 | 2500       | 2.99223 |\n\n### 🔍 Performance Analysis\n\n#### Insert Operations\n- **SQLite3**: 1154.87 ops/s\n- **AnuDB**: 296.068 ops/s\n- SQLite3 is approximately 3.9x faster at inserts\n\n#### Query Operations\n- **SQLite3**: 27.8886 ops/s\n- **AnuDB**: 34.3761 ops/s\n- AnuDB is approximately 1.23x faster at queries\n\n#### Update Operations\n- **SQLite3**: 605.107 ops/s\n- **AnuDB**: 291.104 ops/s\n- SQLite3 is approximately 2.1x faster at updates\n\n#### Delete Operations\n- **SQLite3**: 1819.51 ops/s\n- **AnuDB**: 342.185 ops/s\n- SQLite3 is approximately 5.3x faster at deletes\n\n#### Parallel Operations\n- **SQLite3**: 2.99223 ops/s (2,500 operations)\n- **AnuDB**: 6.99629 ops/s (10,000 operations)\n- AnuDB processed 4x more operations and achieved approximately 2.34x higher ops/s\n\n### 📈 Summary\n- **SQLite3** excels at basic CRUD operations, particularly inserts and deletes\n- **AnuDB** performs better in queries and parallel operations\n- The choice between these databases would depend on your specific workload patterns\n\n## 🛠️ Setup Instructions\n### 1️⃣ Clone and Build AnuDB\n```bash\n# Clone the repository\ngit clone https://github.com/hash-anu/AnuDB.git\ncd AnuDB/third_party/nanomq/\ngit submodule update --init --recursive\ncd ../..\nmkdir build\ncd build\ncmake ..\nmake\nor\n# Configure with ZSTD compression support\ncmake -DZSTD_INCLUDE_DIR=/path/to/zstd/include -DZSTD_LIB_DIR=/path/to/zstd/lib ..\nmake\n```\n### 2️⃣ Clone This Benchmark Repository\n```bash\ngit clone https://github.com/hash-anu/AnuDBBenchmark.git\ncd AnuDBBenchmark\n```\n### 3️⃣ Build the Benchmark\nUse the `build.sh` script to compile the benchmark. You can optionally specify the path to the AnuDB repository:\n```bash\n./build.sh /full/path/to/AnuDB\nOR\n# Run below bash command to compare Sqlite with AnuDB\n./build_anusqlite.sh\n```\nIf no path is given, it defaults to `../AnuDB`.\n### 4️⃣ Run the Benchmark\n```bash\n./benchmark\n```\n---\n## 📈 Benchmark Environment\n- Hardware: Raspberry Pi\n- Both AnuDB and SQLite3 were tested under identical conditions\n---\n## 📚 More Details\nFor methodology and performance insights, please refer to our blog:  \n👉 [Medium](https://medium.com/@hashmak.jsn/absolutely-ca702d276a08)\n\n---\n## 🤩 Example Output\n```\nAnuDB Load Testing Benchmark\n=======================================\n===== Database Benchmark: AnuDB  =====\nConfiguration:\n- Documents: 10000\n- Queries: 1000\n- Parallel Threads: 10\nRunning AnuDB tests...\nIndex created successfully!!!\nIndex created successfully!!!\nIndex created successfully!!!\nIndex created successfully!!!\nIndex created successfully!!!\n  Running insert test...\n  Running query test...\n  Running update test...\n  Running delete test...\n  Running parallel operations test...\nCompleted AnuDB tests.\n===== Benchmark Results =====\nOperation           AnuDB Time(s)  AnuDB Ops      AnuDB Ops/s\nInsert              0.977          10000          10235.4\nQuery               2.870          1000           348.4\nUpdate              0.445          5000           11236.0\nDelete              0.143          2500           17482.5\nParallel            0.648          10000          15432.1\nBenchmark results saved to 'benchmark_results.csv'\n\nIf you build anusqlite_benchmark then below output will be shown:\n\n ./benchmark\nAnuDB Load Testing Benchmark\n=======================================\n===== Database Benchmark: AnuDB vs SQLITE3  =====\nConfiguration:\n- Documents: 10000\n- Queries: 1000\n- Parallel Threads: 4\n\nRunning AnuDB tests...\nIndex created successfully!!!\nIndex created successfully!!!\nIndex created successfully!!!\nIndex created successfully!!!\nIndex created successfully!!!\n  Running insert test...\n  Running query test...\n  Running update test...\n  Running delete test...\n  Running parallel operations test...\n\nCompleted AnuDB tests.\n\nRunning SQLite3 tests...\n  Running insert test...\n  Running query test...\n  Running update test...\n  Running delete test...\n  Running parallel operations test...\nThread 0 failed to commit transaction: cannot commit transaction - SQL statements in progress\n(Note: This is a known limitation due to SQLite’s concurrent transaction handling in multithreaded mode.)\nThread 1 failed to commit transaction: cannot commit transaction - SQL statements in progress\nThread 2 failed to commit transaction: cannot commit transaction - SQL statements in progress\nCompleted SQLite3 tests.\n\n\n===== Benchmark Results =====\nOperation           AnuDB Time(s)  AnuDB Ops      AnuDB Ops/s    SQLite3 Time(s)SQLite3 Ops    SQLite3 Ops/s\nInsert              33.776         10000          296.1          8.659          10000          1154.9\nQuery               29.090         1000           34.4           35.857         1000           27.9\nUpdate              17.176         5000           291.1          8.263          5000           605.1\nDelete              7.306          2500           342.2          1.374          2500           1819.5\nParallel            1429.328       10000          7.0            835.498        2500           3.0\n\n===== Performance Comparison =====\nRatio of AnuDB to SQLite3 (higher means AnuDB is faster)\nOperation           Time Ratio     Ops/s Ratio\nInsert              0.26           0.26\nQuery               1.23           1.23\nUpdate              0.48           0.48\nDelete              0.19           0.19\nParallel            0.58           2.34\n\nBenchmark results saved to 'benchmark_results.csv'\n```\n---\n## 🔧 Troubleshooting\n- Ensure `g++`, `cmake`, and necessary libraries are installed.\n- Use absolute paths to avoid file resolution issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhash-anu%2Fanudbbenchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhash-anu%2Fanudbbenchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhash-anu%2Fanudbbenchmark/lists"}