{"id":13508775,"url":"https://github.com/dalmatinerdb/ddb_client","last_synced_at":"2026-02-18T21:02:47.784Z","repository":{"id":24450359,"uuid":"27852779","full_name":"dalmatinerdb/ddb_client","owner":"dalmatinerdb","description":null,"archived":false,"fork":false,"pushed_at":"2018-03-06T00:57:18.000Z","size":212,"stargazers_count":11,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-11-01T08:14:41.288Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dalmatinerdb.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}},"created_at":"2014-12-11T03:44:46.000Z","updated_at":"2022-10-10T07:58:56.000Z","dependencies_parsed_at":"2022-09-20T02:03:36.826Z","dependency_job_id":null,"html_url":"https://github.com/dalmatinerdb/ddb_client","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/dalmatinerdb/ddb_client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalmatinerdb%2Fddb_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalmatinerdb%2Fddb_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalmatinerdb%2Fddb_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalmatinerdb%2Fddb_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dalmatinerdb","download_url":"https://codeload.github.com/dalmatinerdb/ddb_client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalmatinerdb%2Fddb_client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2024-08-01T02:00:58.240Z","updated_at":"2026-02-18T21:02:47.767Z","avatar_url":"https://github.com/dalmatinerdb.png","language":"Erlang","funding_links":[],"categories":["ORM and Datamapping"],"sub_categories":[],"readme":"## DalmatinerDB Client\n\nAn Erlang TCP client for the dalmatiner time series database.\n\nFirstly, in order to read or write data it is necessary to open a connection:\n\n```erlang\n{ok, Con} = ddb_tcp:connect(\"127.0.0.1\", 5555).\n```\n\nFor efficiency reasons, the Dalmatiner TCP endpoint can only accept incoming data when switched to stream mode.\nTherefore, in order to write data points, a connection needs to be swtiched to\nstream mode as follows:\n\n```erlang\nBucket = \u003c\u003c\"my_bucket\"\u003e\u003e.\n%% The delay is the time in seconds before connection is automatically flushed.\nDelay = 1.\n{ok, SCon} = ddb_tcp:stream_mode(Bucket, Delay, Con).\n```\nValues should first be encoded in binary format using the [mmath](https://github.com/dalmatinerdb/mmath) module,\nbefore attempting to write:\n\n```erlang\nTimestamp = 1466072419.\nBucket = \u003c\u003c\"my_bucket\"\u003e\u003e.\nMetric = dproto:metric_from_list([\u003c\u003c\"base\"\u003e\u003e, \u003c\u003c\"cpu\"\u003e\u003e]).\nValue  = mmath_bin:from_list([63.9, 64.0, 64.1]).\n{ok, SCon1} = ddb_tcp:send(Metric, Timestamp, Value, SCon).\n```\n\nA stream connection is not required in order to perform read operations.  In\naddition to listing metrics and buckets, data for a given point in time can\nbe read as follows:\n\n```erlang\nTimestamp = 1466072419.\nBucket = \u003c\u003c\"my_bucket\"\u003e\u003e.\nMetric = dproto:metric_from_list([\u003c\u003c\"base\"\u003e\u003e, \u003c\u003c\"cpu\"\u003e\u003e]).\nCount = 3.\n{ok, Data, Con1} = ddb_tcp:get(Bucket, Metric, Timestamp, Count, Con).\n```\n\nFinally, a connection should be closed when done:\n```erlang\nCon1 = ddb_tcp:close(Con).\n```\n\nFor more information, please consult the [network protocol\ndocumentation](http://dalmatinerdb.readthedocs.io/en/latest/proto.html).\n\n## Read options\nIt is possible to specify consistency parameters for an individual read operation if so\nrequired.  The following options are available:\n\nRead repair: `{rr, off}` - disables read repair for this get request\n             `{rr, on}` - ensures read repairs for this read request, even on recently written data\n             `{rr, default}` - will use the system defaults\n\nRead quorum: `{r, n}` - will use the same value as N for this get request\n             `{r, R :: pos_integer()}` - will use the value 0 \u003c R \u003c= N for this get request\n             `{r, default}` - will use the system default for R\n\nTo use these options in a read request:\n```erlang\nTimestamp = 1466072419.\nBucket = \u003c\u003c\"my_bucket\"\u003e\u003e.\nMetric = dproto:metric_from_list([\u003c\u003c\"base\"\u003e\u003e, \u003c\u003c\"cpu\"\u003e\u003e]).\nCount = 3.\nOpts = [{rr, off}, {r, 1}].\n{ok, Data, Con1} = ddb_tcp:get(Bucket, Metric, Timestamp, Count, Opts, Con).\n```\n\n## Connection pools\n\nA DalmatinerDB connection is dedicated to send data to a single bucket.  In cases\nwhere data is written to many buckets at once, it is more efficient to\nre-use an existing connection for a bucket instead of opening a new one.\nApplications such as [Pooler](https://github.com/seth/pooler) may be used to\npool and share connections to DDB.\n\n## Building the client\n\nThe client can be compiled using `rebar3`.\n\nLinting rules are specified using the Elvis plugin, and lint rules may be\nchecked by running:\n```\n$ rebar3 as lint lint\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalmatinerdb%2Fddb_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdalmatinerdb%2Fddb_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalmatinerdb%2Fddb_client/lists"}