{"id":20491250,"url":"https://github.com/comboy/komoku","last_synced_at":"2025-08-11T09:10:38.804Z","repository":{"id":66500076,"uuid":"66948911","full_name":"comboy/komoku","owner":"comboy","description":"time series db with pubsub","archived":false,"fork":false,"pushed_at":"2017-03-08T09:30:35.000Z","size":71,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-04T09:08:52.573Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/comboy.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-30T14:36:29.000Z","updated_at":"2017-12-26T12:02:39.000Z","dependencies_parsed_at":"2023-05-23T12:30:56.532Z","dependency_job_id":null,"html_url":"https://github.com/comboy/komoku","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/comboy/komoku","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comboy%2Fkomoku","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comboy%2Fkomoku/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comboy%2Fkomoku/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comboy%2Fkomoku/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/comboy","download_url":"https://codeload.github.com/comboy/komoku/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comboy%2Fkomoku/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269857558,"owners_count":24486395,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-15T17:21:08.069Z","updated_at":"2025-08-11T09:10:38.778Z","avatar_url":"https://github.com/comboy.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Komoku\n\n### key value storage + time series database + pub sub\n\nKomoku is a key value database for different types of data, which keeps track of all changes, and then can compact historical data in a clever way. You can subscribe to different key changes.\n\nFor now the API is going to be compatible with ruby version (https://github.com/comboy/komoku.ruby) but after I migrate my home automation to the new system I'm going to update it.\n\nWhy am I even writing this readme, it's way too early for that.\n\n## Key types\n\nHA denotes my personal use case in home automation as an example\n\n### Numeric\n\nDouble. I'm considering using actual numeric type (specified precision, exact). Currently there's only gauge but I plan adding different types similar to what's known from rrdtool. It should be able to use different aggregations (for now, most of my cases are covered with gauge avg/min/max so I'm focusing on that)\n\nHA: tracking temp, humidity light etc.\n\n### Boolean\n\nTrue and false. But. It represents the state changes that last. So with boolean you should be able to get stats like:\n\n* what value was present at given time\n* uptime-like stats e.g. 99.5% true during last month\n* sum of time stats e.g. number of hours per day for which the state was false\n* maybe common timespans stats (like avg distribution per hour during last month)\n\nBoolean can be used for representing timespans between value changes.\n\nHA: state of the light somewhere, is door open, is window open, how often am I at home\n\n### Uptime\n\nBoolean which automatically goes to false if not updated for `:max_time`\n\n### String\n\nCustom string.\n\n* you can disable compacting and just use it as a log (better yet let's compact it, keeping in mind that it is a logfile), separate type may appear for that\n* or you can be only assigning to it some set of strings representing state of something (stats then are boolean-alike but with more values)\n* or use it to store some kind of config\n\nHA: log, what's the alarm state (armed, disabled, waiting), selected radio station, what room I'm in\n\n## TODO\n\n### Features\n\n* compacting historical data\n* fetching historical data\n* treating booleans as timespans\n* user authentication\n\n### Polishing and optimization\n\n* better error handling, there are supervisors but incorrect user input shouldn't be resulting in any process crash\n* unused key processes can be killed when there's like 100K+ of them\n* add bench for 100K+ keys\n* use benchfella\n* add distillery\n* beter docs\n\n### Low priority features\n\n* protobuf + tcp server\n* http server\n* komowku-web with graphs\n* string opt to only allow specified set of values (careful with `update_key` and historical values that may not comply)\n\n## Architecture\n\n`Komoku.Server` is the main access point. You can call on it things like `get`, `put` or `list_keys`. It also starts outside interfacess like `Komoku.Server.Websocket` according to config.exs. \n\nEach key is handled by a separate process (`KeyHandler`). It stores last value cache in its state, it's responsible for appropriate key value updates (e.g. change value to false for uptime type of key), consolidating data, and fetching it from `Storage` when necessary.\n\n`Storage` is responsible for persistant value store. Basically a database interface.\n\n`KeyMaster` manages keys. It keeps list of all the keys, creates, updates and removes them. It also manages `KeyHandler` processes.\n\n`SubscriptionManager` - you won't guess! `KeyHandler` publishes changes of keys to it, and client processes created by e.g. `Komoku.Server.Websocket` can subscribe to these changes. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomboy%2Fkomoku","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomboy%2Fkomoku","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomboy%2Fkomoku/lists"}