{"id":18575370,"url":"https://github.com/keymetrics/interdb","last_synced_at":"2025-08-13T01:48:42.900Z","repository":{"id":57124563,"uuid":"117859749","full_name":"keymetrics/interdb","owner":"keymetrics","description":":construction_worker: Local and shared database","archived":false,"fork":false,"pushed_at":"2018-09-23T13:37:57.000Z","size":111,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T11:03:35.763Z","etag":null,"topics":["database","discovery","js","key-value","shared-database"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keymetrics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-17T16:07:54.000Z","updated_at":"2024-05-06T00:34:10.000Z","dependencies_parsed_at":"2022-09-15T19:12:34.417Z","dependency_job_id":null,"html_url":"https://github.com/keymetrics/interdb","commit_stats":null,"previous_names":["keymetrics-envision/interdb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keymetrics%2Finterdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keymetrics%2Finterdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keymetrics%2Finterdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keymetrics%2Finterdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keymetrics","download_url":"https://codeload.github.com/keymetrics/interdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248185232,"owners_count":21061477,"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":["database","discovery","js","key-value","shared-database"],"created_at":"2024-11-06T23:19:19.312Z","updated_at":"2025-04-10T08:30:47.528Z","avatar_url":"https://github.com/keymetrics.png","language":"JavaScript","readme":"# InterDB\n\nInterDB is a shared database with auto discovery.\n\n## Example\n\n```javascript\nconst interdb = require('interdb')\n\nconst con = new interdb()\n\n// Global\ncon.startLocal('./path.local.db') // Start local db only\ncon.start({\n    namespace: 'business',\n    password: 'long-password',\n    path: './path.db',\n    localPath: './path.local.db', // optional\n    identity : {\n      // Info that will be shared to other dashboards\n    }\n}) // join network\ncon.stop() // exit network\n\n// Bus\ncon.clients.*\n// Refer to Synapsis documentation (https://github.com/Unitech/synapsis)\n\n// local DB\ncon.localDb.put('key', 'value', cb) // put new data in existing key or create it\ncon.localDb.push('key', 'value', cb) // push data in existing key if it's an array or create an array with value in first index\ncon.localDb.del('key', cb) // delete key\ncon.localDb.get('key') // get value from key\ncon.localDb.updateAll({ data: {} }, cb) // Overwrite database\ncon.localDb.getLastUpdate() // Get timestamp of latest action\ncon.localDb.save(cb) // save changes (use if you modify con.localDb without API)\n\n// Shared DB (all of local API but broadcast changes over network)\ncon.db.put('key', 'value', cb) // put new data in existing key or create it\ncon.db.push('key', 'value', cb) // push data in existing key if it's an array or create an array with value in first index\ncon.db.del('key', cb) // delete key\ncon.db.get('key') // get value from key\ncon.db.updateAll({ data: {} }, cb) // Overwrite database\ncon.db.getLastUpdate() // Get timestamp of latest action\ncon.db.save(cb) // save changes (use if you modify con.db without API)\n```\n\n## Database structure\n\n```json5\n{\n    lastUpdate: \"\",\n    data: {}\n}\n```\n\n## Communication structure\n### Normal\nHost A \u003c-\u003e Host B \u003c-\u003e Host C\n ^----------------------^\n\n### Problem\nHost A \u003c-\u003e Host B \u003c-\u003e Host C","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeymetrics%2Finterdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeymetrics%2Finterdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeymetrics%2Finterdb/lists"}