{"id":16293562,"url":"https://github.com/badsyntax/react-native-lmdb","last_synced_at":"2026-04-30T14:36:44.612Z","repository":{"id":208057821,"uuid":"720728078","full_name":"badsyntax/react-native-lmdb","owner":"badsyntax","description":"React Native bindings for LMDB (WIP)","archived":false,"fork":false,"pushed_at":"2023-11-26T20:06:36.000Z","size":1756,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-24T11:51:05.702Z","etag":null,"topics":["lmdb","react-native"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/badsyntax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2023-11-19T12:20:29.000Z","updated_at":"2024-04-07T21:24:57.000Z","dependencies_parsed_at":"2024-11-05T15:45:39.779Z","dependency_job_id":"5aa0e213-b84a-47e5-b30a-85a8d848bc0c","html_url":"https://github.com/badsyntax/react-native-lmdb","commit_stats":null,"previous_names":["badsyntax/react-native-lmdb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/badsyntax/react-native-lmdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badsyntax%2Freact-native-lmdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badsyntax%2Freact-native-lmdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badsyntax%2Freact-native-lmdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badsyntax%2Freact-native-lmdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badsyntax","download_url":"https://codeload.github.com/badsyntax/react-native-lmdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badsyntax%2Freact-native-lmdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32468009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"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":["lmdb","react-native"],"created_at":"2024-10-10T20:11:44.508Z","updated_at":"2026-04-30T14:36:44.595Z","avatar_url":"https://github.com/badsyntax.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-lmdb\n\n\u003cdiv style=\"overflow:hidden\"\u003e\n\u003ca href=\"https://www.symas.com/lmdb\"\u003e\u003cimg alt=\"LMDB\" src=\"./img/lmdb-logo.png\" width=\"130\" align=\"left\" /\u003e\u003c/a\u003e\n\u003cdiv\u003e\n\n[LMDB](https://www.symas.com/lmdb) (Lightning Memory-Mapped Database) is an embedded transactional database in the form of a key-value store.\n\nThis package embeds \u0026 provides React Native bindings for LMDB.\n\n_NOTE: Under development, not ready for consumption yet!_\n\n\u003c/div\u003e\n\u003c/div\u003e\n\n\u003cbr clear=\"left\"/\u003e\n\n## Installation\n\n```sh\nnpm install react-native-lmdb\ncd ios \u0026\u0026 pod install\n```\n\n## Usage\n\n```js\nimport { open } from 'react-native-lmdb';\n\n// Define the largest size of the db (100mb in this case)\nconst mapSize = 1024 * 1024 * 100;\n\nconst { put, get, del } = open('mydb.mdb', mapSize);\n\nput('key1', 'value1');\nput('key2', 'value2');\n\nconsole.log(get('key1'));\nconsole.log(get('key2'));\n\ndel('key1');\ndel('key2');\n```\n\n## Optimisation\n\nLMDB uses transactions for read/write ops. Batch ops should use a shared transaction to improve perf.\n\nWrite lots of data in a single transaction:\n\n```ts\nconst tidx = beginTransaction(true);\nput('some', 'data', tidx);\nput('other', 'data', tidx);\n// ...\nwriteTransaction(tidx); // write the data to the db\n```\n\nFor reading data, you can use a global read transaction, then reset it to sync with the db.\n\n```ts\n// Make this global, and adjust all get() calls to use this transaction\nconst tidx = beginTransaction();\n\nconst value1 = get('key1', tidx);\nconst value2 = get('key2', tidx);\n\n// Elsewhere in your app, after making changes to your db...\nput('key1', 'new data');\nresetTransaction(tidx); // this allow subsequent get() calls to use the latest db snapshot\n\nconst value1New = get('key1', tidx);\n```\n\n## Motivation\n\nMMKV is a great tool but isn't designed for vast amounts of data.\n\nSQLite can handle vast amounts of data but is async thus increases complexity and introduces possible race conditions.\n\nLMDB is mature, synchronous, and can handle anything you throw at it. 💪\n\n## Goals of this Project\n\n- Simple API\n- Performance over features\n\n## Benchmarks\n\nI am still in the process of profiling and optimising.\n\n\u003c!-- \u003ctable width=\"100%\"\u003e\u003ctr\u003e\u003ctd\u003e\n\n### iOS (Simulator)\n\n|               | react-native-mmkv | react-native-lmdb |\n| ------------- | ----------------- | ----------------- |\n| put 10_000    |                   |                   |\n| get 10_000    |                   |                   |\n| db size run 1 |                   |                   |\n| db size run 2 |                   |                   |\n| db size run 3 |                   |                   |\n\n\u003c/td\u003e\u003ctd\u003e\n\n### iOS (iPhone 7)\n\n|                  | react-native-mmkv | react-native-lmdb |\n| ---------------- | ----------------- | ----------------- |\n| put 10_000       |                   |                   |\n| put 10_000 (txn) |                   |                   |\n| get 10_000       |                   |                   |\n| db size run 1    |                   |                   |\n| db size run 2    |                   |                   |\n| db size run 3    |                   |                   |\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n\u003ctable width=\"100%\"\u003e\u003ctr\u003e\u003ctd\u003e\n\n### Android (Emulator)\n\n|               | react-native-mmkv | react-native-lmdb |\n| ------------- | ----------------- | ----------------- |\n| put 10_000    |                   |                   |\n| get 10_000    |                   |                   |\n| db size run 1 |                   |                   |\n| db size run 2 |                   |                   |\n| db size run 3 |                   |                   |\n\n\u003c/td\u003e\u003ctd\u003e\n\n### Android (Pixel 6a)\n\n|               | react-native-mmkv | react-native-lmdb |\n| ------------- | ----------------- | ----------------- |\n| put 10_000    |                   |                   |\n| get 10_000    |                   |                   |\n| db size run 1 |                   |                   |\n| db size run 2 |                   |                   |\n| db size run 3 |                   |                   |\n\n\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nWe can conclude:\n\n// @TODO --\u003e\n\n## Credits\n\n- Thanks to [sysmas](https://www.symas.com/) for open sourcing lmdb.\n\n## Donate\n\nIf you find LMDB useful please consider supporting the OpenLDAP foundation: https://www.openldap.org/foundation/\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n\n---\n\nMade with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)\n\n```\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadsyntax%2Freact-native-lmdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadsyntax%2Freact-native-lmdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadsyntax%2Freact-native-lmdb/lists"}