{"id":32475988,"url":"https://github.com/dashersw/memgoose-wiredtiger","last_synced_at":"2025-10-27T22:01:17.631Z","repository":{"id":320069626,"uuid":"1080524882","full_name":"dashersw/memgoose-wiredtiger","owner":"dashersw","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-21T20:21:48.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-21T20:28:47.147Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/dashersw.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-21T13:45:33.000Z","updated_at":"2025-10-21T20:21:21.000Z","dependencies_parsed_at":"2025-10-21T20:28:54.179Z","dependency_job_id":"86091981-bef2-4fac-a759-4b2ecce4ccd1","html_url":"https://github.com/dashersw/memgoose-wiredtiger","commit_stats":null,"previous_names":["dashersw/memgoose-wiredtiger"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dashersw/memgoose-wiredtiger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashersw%2Fmemgoose-wiredtiger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashersw%2Fmemgoose-wiredtiger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashersw%2Fmemgoose-wiredtiger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashersw%2Fmemgoose-wiredtiger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dashersw","download_url":"https://codeload.github.com/dashersw/memgoose-wiredtiger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashersw%2Fmemgoose-wiredtiger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281178831,"owners_count":26456678,"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-10-26T02:00:06.575Z","response_time":61,"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-10-26T21:28:14.310Z","updated_at":"2025-10-27T22:01:17.625Z","avatar_url":"https://github.com/dashersw.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# memgoose-wiredtiger\n\nWiredTiger storage backend for [memgoose](https://github.com/dashersw/memgoose) - the high-performance storage engine that powers MongoDB.\n\n**Version:** WiredTiger 11.3.1\n**Platforms:** macOS, Linux, Windows\n\n## Installation\n\n```bash\nnpm install memgoose-wiredtiger\n```\n\n### Prerequisites\n\n- Node.js 16+ with N-API support\n- CMake 3.10+\n- C++ compiler (gcc, clang, or MSVC)\n- Python 3 (for node-gyp)\n\n**Platform-specific:**\n\n- **macOS**: `xcode-select --install` + `brew install cmake`\n- **Linux**: `sudo apt-get install build-essential cmake` (Ubuntu/Debian) or `sudo dnf install gcc-c++ make cmake` (Fedora/RHEL)\n- **Windows**: [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) with C++ tools + [CMake](https://cmake.org/download/)\n\n**Compression libraries (recommended):**\n\nWiredTiger supports several compression algorithms. Install the ones you need:\n\n- **macOS**: `brew install snappy zlib lz4 zstd`\n- **Linux**: `sudo apt-get install libsnappy-dev zlib1g-dev liblz4-dev libzstd-dev` (Ubuntu/Debian) or `sudo dnf install snappy-devel zlib-devel lz4-devel libzstd-devel` (Fedora/RHEL)\n- **Windows**: Libraries are typically bundled with vcpkg: `vcpkg install snappy zlib lz4 zstd`\n\n\u003e **Note:** After installing compression libraries, you must rebuild: `npm rebuild` or delete `lib/wiredtiger/build/` and reinstall.\n\n## Usage\n\n```typescript\nimport { connect } from 'memgoose'\n\nconst db = connect({\n  storage: 'wiredtiger',\n  wiredtiger: {\n    dataPath: './data/wiredtiger',\n    cacheSize: '500M'\n  }\n})\n```\n\n## Features\n\n- **High Performance**: Optimized for both read and write-heavy workloads\n- **ACID Transactions**: Full transactional support with durability guarantees\n- **Efficient Storage**: Built-in compression and space reclamation\n- **Scalability**: MVCC (Multi-Version Concurrency Control) for high concurrency\n- **WAL Logging**: Write-Ahead Logging for crash recovery\n\n## Configuration\n\n```typescript\ninterface WiredTigerStorageOptions {\n  dataPath: string // Directory where WiredTiger stores data\n  cacheSize?: string // Cache size (e.g., \"500M\", \"1G\", \"2G\")\n  // Default: \"500M\"\n}\n```\n\n## Performance\n\nWiredTiger provides excellent performance for production workloads:\n\n- **Insert 10k docs**: ~58ms\n- **Query (indexed)**: ~0.14ms\n- **Bulk insert 100k**: ~520ms\n\nSee [memgoose performance docs](https://github.com/dashersw/memgoose/blob/main/docs/PERFORMANCE.md) for detailed benchmarks.\n\n## Examples\n\nTwo complete working examples are provided:\n\n### Standalone WiredTiger (`example/standalone/`)\n\nDirect usage of WiredTiger bindings without memgoose:\n\n```bash\ncd example/standalone\nnpm install \u0026\u0026 npm start\n```\n\n### With Memgoose (`example/with-memgoose/`)\n\nFull memgoose integration with WiredTiger storage:\n\n```bash\ncd example/with-memgoose\nnpm install \u0026\u0026 npm start\n```\n\n## Direct API Usage\n\nYou can also use the WiredTiger bindings directly without memgoose:\n\n```typescript\nimport { WiredTigerConnection } from 'memgoose-wiredtiger'\n\nconst conn = new WiredTigerConnection()\nconn.open('./data', 'create')\n\nconst session = conn.openSession()\nsession.createTable('users', 'key_format=u,value_format=u')\n\nconst cursor = session.openCursor('users')\ncursor.set('key1', 'value1')\ncursor.insert()\n\nconst value = cursor.search('key1')\nconsole.log(value) // 'value1'\n\ncursor.close()\nsession.close()\nconn.close()\n```\n\nSee `example/standalone/` for a complete working example.\n\n## Build Details\n\nThis package uses a **cross-platform build process**:\n\n1. **CMake** builds WiredTiger library (`libwiredtiger.dylib`/`.so`/`.dll`) with compression support\n2. **node-gyp** compiles the N-API bindings and links against WiredTiger\n3. Supports **macOS** (Clang), **Linux** (GCC), and **Windows** (MSVC)\n\nAll build scripts are pure Node.js - no bash required for Windows compatibility.\n\n## Troubleshooting\n\n**Build fails:**\n\n- Ensure CMake is installed: `cmake --version`\n- Check C++ compiler is available\n- On Windows, use \"Developer Command Prompt for VS 2022\"\n\n**Runtime error \"WiredTiger native bindings not available\":**\n\n- Run `npm rebuild` to rebuild the native addon\n- Check that `build/Release/wiredtiger_native.node` exists\n\n**Database won't open:**\n\n- Ensure the data directory exists and is writable\n- Check no other process has the database open (WiredTiger uses file locks)\n\n**Compression error (\"unknown compressor 'snappy'\"):**\n\nThis means WiredTiger was built without compression support. To fix:\n\n1. Install compression libraries (see Prerequisites above)\n2. Delete the build directory: `rm -rf lib/wiredtiger/build/`\n3. Rebuild: `npm rebuild`\n\nIf you don't need compression, remove the compression option from your table config (e.g., remove `block_compressor=snappy`)\n\n## License\n\nThis project (memgoose-wiredtiger bindings) is licensed under the MIT License.\n\n### WiredTiger License\n\nThis package includes WiredTiger, which is dual-licensed under GPL v2 or GPL v3 (your choice):\n\n- Copyright (c) 2014-present MongoDB, Inc.\n- Copyright (c) 2008-2014 WiredTiger, Inc.\n\nYou may redistribute and/or modify WiredTiger under the terms of either the GNU General Public License version 2 or version 3 as published by the Free Software Foundation. See `lib/wiredtiger/LICENSE` for full details.\n\nFor commercial licensing options or technical support, contact MongoDB, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdashersw%2Fmemgoose-wiredtiger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdashersw%2Fmemgoose-wiredtiger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdashersw%2Fmemgoose-wiredtiger/lists"}