{"id":22378216,"url":"https://github.com/apb9785/diamond","last_synced_at":"2025-07-31T00:30:52.852Z","repository":{"id":227146581,"uuid":"770577843","full_name":"APB9785/diamond","owner":"APB9785","description":"The fastest read-only key/value store for Elixir","archived":false,"fork":false,"pushed_at":"2024-03-20T02:55:26.000Z","size":112,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-09T19:49:14.891Z","etag":null,"topics":["elixir","in-memory-database"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/APB9785.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}},"created_at":"2024-03-11T19:41:44.000Z","updated_at":"2024-11-02T19:53:46.000Z","dependencies_parsed_at":"2024-03-19T05:35:30.763Z","dependency_job_id":null,"html_url":"https://github.com/APB9785/diamond","commit_stats":null,"previous_names":["apb9785/diamond"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APB9785%2Fdiamond","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APB9785%2Fdiamond/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APB9785%2Fdiamond/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APB9785%2Fdiamond/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/APB9785","download_url":"https://codeload.github.com/APB9785/diamond/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228198803,"owners_count":17883776,"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","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":["elixir","in-memory-database"],"created_at":"2024-12-04T22:18:06.147Z","updated_at":"2024-12-04T22:18:06.697Z","avatar_url":"https://github.com/APB9785.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Diamond\n\n[![Hex Version](https://img.shields.io/hexpm/v/diamond.svg)](https://hex.pm/packages/diamond)\n[![License](https://img.shields.io/hexpm/l/diamond.svg)](https://github.com/APB9785/diamond/blob/master/LICENSE)\n[![Documentation](https://img.shields.io/badge/documentation-gray)](https://hexdocs.pm/diamond)\n\nDiamond is a read-only in-memory key/value storage optimized for the fastest possible read times.\n\n## Installation\n\nAdd `:diamond` to your list of dependencies in `mix.exs`:\n```elixir\ndefp deps do\n  [\n    {:diamond, \"~\u003e 0.1\"}\n  ]\nend\n```\n\n## Usage\n\n```elixir\ndata = %{foo: \"bar\", baz: \"bong\"}\n:ok = Diamond.initialize(data)\n\n\"bar\" = Diamond.get(:foo)\n```\n\n## Benchmarks (Read Times)\n\n#### Small (1,000 keys)\n```\nDiamond           - 81_918_000 / sec  \n:persistent_term  - 45_045_000 / sec  (1.8x slower)  \n:ets (async)      -  9_176_000 / sec  (8x slower)  \nGenServer (Map)   -    946_000 / sec  (86x slower)  \n:ets (serialized) -    823_000 / sec  (99x slower)  \n```\n#### Medium (10,000 keys)\n```\nDiamond           - 72_992_000 / sec  \n:persistent_term  - 39_354_000 / sec  (1.8x slower)  \n:ets (async)      -  8_693_000 / sec  (8x slower)  \nGenServer (Map)   -    928_000 / sec  (78x slower)  \n:ets (serialized) -    823_000 / sec  (88x slower)  \n```\n#### Large (100,000 keys)\n```\nDiamond           - 57_844_000 / sec  \n:persistent_term  - 34_447_000 / sec  (1.6x slower)  \n:ets (async)      -  8_591_000 / sec  (6x slower)  \nGenServer (Map)   -    922_000 / sec  (62x slower)  \n:ets (serialized) -    821_000 / sec  (70x slower)  \n```\n\n## Benchmarks (Initialization Times)\n\nThe time to initialize the data into memory grows linearly with the size of your dataset.\n\n![Data Initialization Times](assets/data_initialization_time.png)\n\nTherefore, take care when initializing large datasets (especially 100,000+ keys).\n\n## Notes on Benchmarks\n\nDatasets consist of a map for each key, where each map contains 12 sub-keys with string values,\nand each string contains ~26 alphanumeric characters.\n\nBenchmarks were run on a 2021 Macbook Pro, using the [benchee](https://github.com/bencheeorg/benchee) library.\n\n## License\n\nCopyright (C) 2024 Andrew P Berrien\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [GNU General Public License](https://www.gnu.org/licenses/gpl.html) for more details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapb9785%2Fdiamond","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapb9785%2Fdiamond","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapb9785%2Fdiamond/lists"}