{"id":17190666,"url":"https://github.com/nicknaso/node-simdb","last_synced_at":"2026-01-19T22:01:23.395Z","repository":{"id":74155372,"uuid":"131741743","full_name":"NickNaso/node-simdb","owner":"NickNaso","description":"Node.js high performance, shared memory, lock free, cross platform, single file, no dependencies, C++11 key-value store","archived":false,"fork":false,"pushed_at":"2020-05-18T22:12:28.000Z","size":92,"stargazers_count":3,"open_issues_count":14,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-06T06:28:40.324Z","etag":null,"topics":["cpp","cross-platform","database","high-performance","javascript","lock-free","native-module","nodejs","shared-memory"],"latest_commit_sha":null,"homepage":"http://nacios.it","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NickNaso.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-05-01T17:23:36.000Z","updated_at":"2020-05-18T22:12:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"512e7db3-de59-4712-8d78-38745cd07ddc","html_url":"https://github.com/NickNaso/node-simdb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NickNaso/node-simdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickNaso%2Fnode-simdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickNaso%2Fnode-simdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickNaso%2Fnode-simdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickNaso%2Fnode-simdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NickNaso","download_url":"https://codeload.github.com/NickNaso/node-simdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickNaso%2Fnode-simdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28587043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T20:45:59.482Z","status":"ssl_error","status_checked_at":"2026-01-19T20:45:41.500Z","response_time":67,"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":["cpp","cross-platform","database","high-performance","javascript","lock-free","native-module","nodejs","shared-memory"],"created_at":"2024-10-15T01:23:32.545Z","updated_at":"2026-01-19T22:01:23.165Z","avatar_url":"https://github.com/NickNaso.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://github.com/NickNaso/node-simdb/raw/master/node-simdb.png\"/\u003e\n\u003c/div\u003e\n\n# node-simdb\n\n**node-simdb** is a binding of **SimDB** that consist of a key value store that \nuses arbitrary byte data (of arbitrary length) as both the key and the value. It \nadditionally uses shared memory, which allows processes to communicate with each \nother quickly. It is lock free and scales well with multiple threads writing, \nreading, and deleting concurrently.\n\nThis package is a wrapper around the simdb C library.\n\n## This module is under development yet :-) \n### It will be a long process end this project and every help will be welcome\n### Give me other time i work with :heart: for all of you\n\n* [Introduction](#introduction)\n* [Supported platforms](#supported_platforms)\n* [Prerequisites](#prerequisites)\n* [Installation](#install)\n* [Usage](#usage)\n* [API](#api)\n* [Code of conduct](CODE_OF_CONDUCT.md)\n* [Team](#team)\n* [Acknowledgements](#acknowledgements)\n* [License](#license)\n\n\u003ca name=\"introduction\"\u003e\u003c/a\u003e\n\n## Introduction\n\n### What is SimDB\n\n**SimDB** is a key value store that uses arbitrary byte data (of arbitrary length)\nas both the key and the value. It additionally uses shared memory, which allows \nprocesses to communicate with each other quickly. It is lock free and scales well \nwith multiple threads writing, reading, and deleting concurrently.\n\n**SimDB** contains the user facing interface. It contains the `ConcurrentHash`, \n`ConcurentStore`, and `SharedMem` classes as members. These data structures are \nmade to be an interface over the contiguous memory given to them using a single \naddress. They do not allocate any heap memory themselves, but do have a few class \nmembers that will be on the stack. At the time of this writing it is 176 bytes on\nthe stack.\n\n* `SharedMem`: Interface to OS specific shared memory functions.  Also handles \nan initial alignment.\n* `ConcurrentHash`: Hash map that uses atomic operations on an array of VerIdx \nstructs. It uses 64 bit atomic operations to compare-exchange one VerIdx at a \ntime (VerIdx is two unsigned 32 bit integers, a version and an index). This makes\nsure that reading, writing and deleting is lock free. Writing is lock free since \na VerIdx is already fully created and written to before putting it in the VerIdx \narray (m_vis) and the put operation here is a single 64 bit compare and swap. \nDeletion is lock free since the index in VerIdx is only freed from the CncrLst \nafter setting the VerIdx here to DELETED. Actually deletion means 1. setting the \nVerIdx to DELETED 2. decrementing the readers of the blocklist that idx points \nto 3. If the readers variable of that blocklist is decremented below its initial \nvalue then the thread that took it below its initial value is the one to free it. \nGet is lock free since it can read an index from a VerIdx, increment readers, \ncompare its key to the key in the list of blocks, read the value in the blocks to\nthe output buffer and finally decrement the readers variable. Just like deletion,\nif a thread decrements readers below its initial value, it needs to free the block \nlist.  This means the last one out cleans up.\n* `ConcurrentStore`: Keeps track of block lists. This primarily uses an array of \nBlkLst structs (which are 24 bytes each). The BlkLst lava_vec is used to make \nlinked lists of block indices. The idea of a block list ends up being a starting \nindex (from the VerIdx struct in the concurrent hash). The BlkLst struct at the \nstarting index contains an index of the next BlkLst struct and so on until \nreaching a BlkLst that has an index of LIST_END. This means that one array \ncontains multiple linked lists (using indices and not pointers of course). This \nexposes an alloc() function and a free() function. alloc() gets the index of the \nnext block from CncrLst (concurrent list). The BlkLst struct keeps the total \nlength and the key length / value offset since it does not have to be atomic and \nis only initialized and used when one thread allocates and only destroyed when \none thread frees, just like the actual data blocks.\n* `ConcurrentList`: \nThe concurrent list is an array integers. The number of elements (like all the arrays)\nis the number of blocks.There is one integer per block with the integer at a \ngiven index representing the next slot in the list. The end of the list will have\nvalue LIST_END. On initialization the array's values would be |1|2|3|4| ... LIST_END, \nwhich makes a list from the start to the end. This means s_lv[0] would return 1.\n\n...\n\n\u003ca name=\"supported_platforms\"\u003e\n\n## Supported platforms\n\n...\n\n\u003ca name=\"prerequisites\"\u003e\u003c/a\u003e\n\n## Prerequisites\n\n...\n\n\u003ca name=\"install\"\u003e\u003c/a\u003e\n\n## Installation\n\n...\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n\n## Usage\n\n...\n\n\u003ca name=\"api\"\u003e\u003c/a\u003e\n\n## API\n\n\u003ca name=\"team\"\u003e\u003c/a\u003e\n\n## The Team\n\n### Nicola Del Gobbo\n\n\u003chttps://github.com/NickNaso/\u003e\n\n\u003chttps://www.npmjs.com/~nicknaso\u003e\n\n\u003chttps://twitter.com/NickNaso\u003e\n\n### Mauro Doganieri\n\n\u003chttps://github.com/mauro-d\u003e\n\n\u003chttps://www.npmjs.com/~mauro-d\u003e\n\n\u003chttps://twitter.com/maurodoganieri\u003e\n\n### Pierluigi Iannarelli\n\n\u003chttps://github.com/Govee91\u003e\n\n\u003chttps://twitter.com/pierluigiiannar\u003e\n\n\u003ca name=\"acknowledgements\"\u003e\u003c/a\u003e\n\n## Acknowledgements\n\nThank you to all people that encourage me every day.\n\n\u003ca name=\"license\"\u003e\u003c/a\u003e\n\n## License\n\nLicensed under [Apache license V2](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicknaso%2Fnode-simdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicknaso%2Fnode-simdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicknaso%2Fnode-simdb/lists"}