{"id":16701957,"url":"https://github.com/lpgauth/marina","last_synced_at":"2025-08-30T20:14:32.644Z","repository":{"id":27131841,"uuid":"30600343","full_name":"lpgauth/marina","owner":"lpgauth","description":"High-Performance Erlang Cassandra / Scylla CQL Client","archived":false,"fork":false,"pushed_at":"2025-05-08T19:38:54.000Z","size":3557,"stargazers_count":58,"open_issues_count":2,"forks_count":19,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-20T09:06:09.249Z","etag":null,"topics":["cassandra","client","cql","erlang","high-performance"],"latest_commit_sha":null,"homepage":"","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/lpgauth.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,"zenodo":null}},"created_at":"2015-02-10T16:02:50.000Z","updated_at":"2025-05-08T19:38:17.000Z","dependencies_parsed_at":"2024-03-22T19:48:01.416Z","dependency_job_id":"03e49f98-91ad-4089-82c4-23acb953e13d","html_url":"https://github.com/lpgauth/marina","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/lpgauth/marina","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpgauth%2Fmarina","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpgauth%2Fmarina/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpgauth%2Fmarina/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpgauth%2Fmarina/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lpgauth","download_url":"https://codeload.github.com/lpgauth/marina/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpgauth%2Fmarina/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272900164,"owners_count":25012034,"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-30T02:00:09.474Z","response_time":77,"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":["cassandra","client","cql","erlang","high-performance"],"created_at":"2024-10-12T18:46:18.339Z","updated_at":"2025-08-30T20:14:32.622Z","avatar_url":"https://github.com/lpgauth.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# marina\nHigh-Performance Erlang Cassandra / Scylla CQL Client\n\n### Requirements\n\n* Cassandra 2.1+\n* Erlang 19.0+\n\n## Features\n\n* Authentication support\n* Compression support (LZ4)\n* CQL spec 3.2.0\n* Fast pool implementation (random, round_robin)\n* Load-balancing policies (random, token_aware)\n* Performance optimized\n* Prepared statement cache\n\n## Environment variables\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctheader\u003e\n    \u003cth\u003eName\u003c/th\u003e\n    \u003cth\u003eType\u003c/th\u003e\n    \u003cth\u003eDefault\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/theader\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ebootstrap_ips\u003c/td\u003e\n    \u003ctd\u003e[list()]\u003c/td\u003e\n    \u003ctd\u003e[\"5.5.5.5\", \"5.5.5.6\"]\u003c/td\u003e\n    \u003ctd\u003eips used to bootstrap the pool\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ecompression\u003c/td\u003e\n    \u003ctd\u003eboolean()\u003c/td\u003e\n    \u003ctd\u003efalse\u003c/td\u003e\n    \u003ctd\u003eenable lz4 compression\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ekeyspace\u003c/td\u003e\n    \u003ctd\u003eundefined | binary()\u003c/td\u003e\n    \u003ctd\u003eundefined\u003c/td\u003e\n    \u003ctd\u003edefault keyspace\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003epassword\u003c/td\u003e\n    \u003ctd\u003ebinary()\u003c/td\u003e\n    \u003ctd\u003eundefined\u003c/td\u003e\n    \u003ctd\u003epassword for authentication\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003epool_size\u003c/td\u003e\n    \u003ctd\u003epos_integer()\u003c/td\u003e\n    \u003ctd\u003e16\u003c/td\u003e\n    \u003ctd\u003enumber of connections per node\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eport\u003c/td\u003e\n    \u003ctd\u003epos_integer()\u003c/td\u003e\n    \u003ctd\u003e9042\u003c/td\u003e\n    \u003ctd\u003eserver port\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ereconnect\u003c/td\u003e\n    \u003ctd\u003eboolean()\u003c/td\u003e\n    \u003ctd\u003etrue\u003c/td\u003e\n    \u003ctd\u003ereconnect closed connections\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ereconnect_time_max\u003c/td\u003e\n    \u003ctd\u003epos_integer() | infinity\u003c/td\u003e\n    \u003ctd\u003e120000\u003c/td\u003e\n    \u003ctd\u003ereconnect maximum time\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ereconnect_time_min\u003c/td\u003e\n    \u003ctd\u003epos_integer()\u003c/td\u003e\n    \u003ctd\u003e1500\u003c/td\u003e\n    \u003ctd\u003ereconnect minimum time\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003estrategy\u003c/td\u003e\n    \u003ctd\u003erandom | token_aware\u003c/td\u003e\n    \u003ctd\u003etoken_aware\u003c/td\u003e\n    \u003ctd\u003eload balancing strategy across nodes\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eusername\u003c/td\u003e\n    \u003ctd\u003ebinary()\u003c/td\u003e\n    \u003ctd\u003eundefined\u003c/td\u003e\n    \u003ctd\u003eusername for authentication\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Bootstraping\n\nThe pool is bootstraped by querying the `system.peers` table. `marina` will try each ip from `boostrap_ips` until it can connect and retrieve the list of peers. For backward compatibility, `ip` will be used if `bootstrap_ips` is not provided.\n\n### Examples\n\n```erlang\n1\u003e marina_app:start().\n\n{ok,[granderl,metal,shackle,foil,marina]}\n\n2\u003e marina:query(\u003c\u003c\"SELECT * FROM test.users LIMIT 1;\"\u003e\u003e, #{timeout =\u003e 1000}).\n\n{ok,{result,{result_metadata,4,\n    [{column_spec,\u003c\u003c\"test\"\u003e\u003e,\u003c\u003c\"users\"\u003e\u003e,\u003c\u003c\"key\"\u003e\u003e,uid},\n     {column_spec,\u003c\u003c\"test\"\u003e\u003e,\u003c\u003c\"users\"\u003e\u003e,\u003c\u003c\"column1\"\u003e\u003e,varchar},\n     {column_spec,\u003c\u003c\"test\"\u003e\u003e,\u003c\u003c\"users\"\u003e\u003e,\u003c\u003c\"column2\"\u003e\u003e,varchar},\n     {column_spec,\u003c\u003c\"test\"\u003e\u003e,\u003c\u003c\"users\"\u003e\u003e,\u003c\u003c\"value\"\u003e\u003e,blob}],\n    undefined},\n    1,\n    [[\u003c\u003c153,73,45,254,217,74,17,228,175,57,88,244,65,16,117,125\u003e\u003e,\n      \u003c\u003c\"test\"\u003e\u003e,\u003c\u003c\"test2\"\u003e\u003e,\n      \u003c\u003c0,0,0,0\u003e\u003e]]}}\n}}\n\n3\u003e marina:query(\u003c\u003c\"SELECT * FROM test.users WHERE key = ?;\"\u003e\u003e,\n    #{values =\u003e [\u003c\u003c153,73,45,254,217,74,17,228,175,57,88,244,65,16,117,125\u003e\u003e],\n    skip_metadata =\u003e true, timeout =\u003e 1000}).\n\n{ok,{result,{result_metadata,4,[],undefined},\n    1,\n    [[\u003c\u003c153,73,45,254,217,74,17,228,175,57,88,244,65,16,117,\n        125\u003e\u003e,\n      \u003c\u003c\"test\"\u003e\u003e,\u003c\u003c\"test2\"\u003e\u003e,\n      \u003c\u003c0,0,0,0\u003e\u003e]]}}\n\n4\u003e {ok, Ref} = marina:async_reusable_query(\u003c\u003c\"SELECT * FROM test.users WHERE key = ?;\"\u003e\u003e,\n    #{values =\u003e [\u003c\u003c207,85,107,110,157,137,17,226,167,153,120,43,203,102,219,173\u003e\u003e]}).\n\n{ok,{'marina_df74df08-e5bc-42e8-af61-c24dfeda6f2c_5',#Ref\u003c0.1577389904.1118830594.250171\u003e}}\n\n5\u003e marina:receive_response(Ref).\n\n{ok,{result,{result_metadata,4,\n    [{column_spec,\u003c\u003c\"test\"\u003e\u003e,\u003c\u003c\"users\"\u003e\u003e,\u003c\u003c\"key\"\u003e\u003e,uid},\n     {column_spec,\u003c\u003c\"test\"\u003e\u003e,\u003c\u003c\"users\"\u003e\u003e,\u003c\u003c\"column1\"\u003e\u003e,varchar},\n     {column_spec,\u003c\u003c\"test\"\u003e\u003e,\u003c\u003c\"users\"\u003e\u003e,\u003c\u003c\"column2\"\u003e\u003e,varchar},\n     {column_spec,\u003c\u003c\"test\"\u003e\u003e,\u003c\u003c\"users\"\u003e\u003e,\u003c\u003c\"value\"\u003e\u003e,blob}],\n        undefined},\n            0,[]}}\n```\n\n## Tests\n\n```makefile\nmake dialyzer\nmake eunit\nmake xref\n```\n\n### TODOs\n\n* Batch queries\n* Rebuild ring when topology changes\n\n## License\n\n```license\nThe MIT License (MIT)\n\nCopyright (c) 2015-2024 Louis-Philippe Gauthier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpgauth%2Fmarina","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpgauth%2Fmarina","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpgauth%2Fmarina/lists"}