{"id":17739022,"url":"https://github.com/pierrekieffer/mstore","last_synced_at":"2025-07-13T23:07:18.927Z","repository":{"id":120128921,"uuid":"271225035","full_name":"PierreKieffer/mstore","owner":"PierreKieffer","description":"In-memory storage management system for embedded data storage","archived":false,"fork":false,"pushed_at":"2020-11-17T17:16:46.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-19T04:17:11.309Z","etag":null,"topics":["cache-storage","embedded-database","in-memory-caching","in-memory-database","in-memory-storage"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PierreKieffer.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}},"created_at":"2020-06-10T08:42:57.000Z","updated_at":"2024-01-10T15:34:09.000Z","dependencies_parsed_at":"2024-06-12T01:20:23.234Z","dependency_job_id":null,"html_url":"https://github.com/PierreKieffer/mstore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PierreKieffer/mstore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PierreKieffer%2Fmstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PierreKieffer%2Fmstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PierreKieffer%2Fmstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PierreKieffer%2Fmstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PierreKieffer","download_url":"https://codeload.github.com/PierreKieffer/mstore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PierreKieffer%2Fmstore/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265218708,"owners_count":23729526,"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":["cache-storage","embedded-database","in-memory-caching","in-memory-database","in-memory-storage"],"created_at":"2024-10-26T02:06:58.965Z","updated_at":"2025-07-13T23:07:18.867Z","avatar_url":"https://github.com/PierreKieffer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mstore \n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"logo.png\"\u003e\n\u003c/p\u003e\n\n\n![Go](https://github.com/PierreKieffer/mstore/workflows/Go/badge.svg)\n\nIn-memory storage management system for embedded data storage.\n\nAs an example of application, mstore can be used as the core of a cache system, or simply as an embedded database.\n\nmstore uses an indexing system to optimize operations performance.\nmstore can manage multiple documents on the same index, but it is not possible to have several documents with the same key (the key is unique and is used to reference a document).\n\n\n\t\t\t\t\t\t      +-------+             data memory slot\n\t\t\t\t\t\t      |       |            +--------+-----------+\n\t\t\t\t\t       index  |       |            |        |           |\n\t\t\t\t     +-------\u003e memory | Index +-----------\u003e+ Key_i  | Data      |\n\t\t\t\t     |         slot   |   01  |            |        |           |\n\t\t\t\t     |                |       |            +--------+-----------+\n\t\t\t\t     |                +-------+\n\t\t\t\t     |                |       |\n\t\t\t\t     |                |       |\n\t\t\t\t     |                |       |\n\t+-----------+                |                |       |\n\t|           |                |                |       |\n\t| Data      +----------------+                +-------+\n\t|           | hash function                   |       |            +--------+-----------+             +--------+----------+\n\t+-----------+                                 |       |            |        |           |             |        |          |\n\t\t\t\t\t\t      | Index +-----------\u003e+ Key_j  |  Data     +------------\u003e+ Key_k  | Data     |\n\t\t\t\t\t\t      |   ..  |            |        |           |             |        |          |\n\t\t\t\t\t\t      |       |            +--------+-----------+             +--------+----------+\n\t\t\t\t\t\t      +-------+\n\t\t\t\t\t\t      |       |\n\t\t\t\t\t\t      |       |\n\t\t\t\t\t\t      |       |\n\t\t\t\t\t\t      |       |\n\t\t\t\t\t\t      |       |\n\t\t\t\t\t\t      +-------+\n\t\t\t\t\t\t      |       |\n\t\t\t\t\t\t      |       |\n\t\t\t\t\t\t      |       |\n\t\t\t\t\t\t      +       +\n\n\n## Download\n```bash \ngo get github.com/PierreKieffer/mstore\n```\n## Usage \n\n```go\nimport(\n\t\"github.com/PierreKieffer/mstore\"\n)\n```\n### Initialize storage \n\n```go \ns := mstore.InitStorage()\n```\nBy default, the storage is built with 1000 indexes,\n\nIt is possible to configure the maximum number of indexes that make up the storage\n\n```go\ns := mstore.InitStorage(10)\n```\n\n### Document type \nmstore uses a Document type : \n\n``` go \ntype Document struct {\n        Key  string\n        Data interface{}\n}\n```\nDocuments are referenced by document key which must be unique.\n\nIf no custom key is passed, a key is generated in UnixNano format.\n\n### Insert  \n\n```go\nvar data interface{} \ndocument := mstore.Document{Key: \"custom-key\", Data: data}\nerr = mstore.Insert(s, document)\nif err != nil {\n\tfmt.Println(err)\n}\n```\n\n### Update \n\n```go\nerr = mstore.Update(s, document)\nif err != nil {\n\tfmt.Println(err)\n}\n```\n\n### Delete \n\n```go\nerr := mstore.Delete(s, key)\nif err != nil {\n\tfmt.Println(err)\n}\n```\n\n### Find \n\n```go\ndoc, err := mstore.Find(s, key)\nif err != nil {\n\tfmt.Println(err)\n}\n```\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierrekieffer%2Fmstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpierrekieffer%2Fmstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierrekieffer%2Fmstore/lists"}