{"id":21948106,"url":"https://github.com/evolution-gaming/sharding-strategy","last_synced_at":"2025-04-23T00:16:15.866Z","repository":{"id":30073115,"uuid":"123831007","full_name":"evolution-gaming/sharding-strategy","owner":"evolution-gaming","description":"Custom sharding strategies for akka cluster","archived":false,"fork":false,"pushed_at":"2025-04-15T06:24:11.000Z","size":250,"stargazers_count":9,"open_issues_count":2,"forks_count":2,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-23T00:16:08.493Z","etag":null,"topics":["akka","cluster","scala","sharding"],"latest_commit_sha":null,"homepage":null,"language":"Scala","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/evolution-gaming.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":"2018-03-04T21:31:52.000Z","updated_at":"2025-04-15T06:24:15.000Z","dependencies_parsed_at":"2024-11-21T16:31:53.976Z","dependency_job_id":"402d729f-045f-476b-a539-4254618baf05","html_url":"https://github.com/evolution-gaming/sharding-strategy","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Fsharding-strategy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Fsharding-strategy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Fsharding-strategy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Fsharding-strategy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evolution-gaming","download_url":"https://codeload.github.com/evolution-gaming/sharding-strategy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250343957,"owners_count":21415041,"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":["akka","cluster","scala","sharding"],"created_at":"2024-11-29T05:12:01.132Z","updated_at":"2025-04-23T00:16:15.842Z","avatar_url":"https://github.com/evolution-gaming.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Versions\nFrom version `2.0.0` this library is based on **cats-effect-3**. If you want to use it with **cats-effect-2**,\nyou need to use version prior to `2.0.0`, for example, `1.0.7`\n\n# Sharding Strategies\n[![Build Status](https://github.com/evolution-gaming/sharding-strategy/workflows/CI/badge.svg)](https://github.com/evolution-gaming/sharding-strategy/actions?query=workflow%3ACI)\n[![Coverage Status](https://coveralls.io/repos/github/evolution-gaming/sharding-strategy/badge.svg?branch=master)](https://coveralls.io/github/evolution-gaming/sharding-strategy?branch=master)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d60baa5803c542d6b4437cb2a5541ab4)](https://www.codacy.com/app/evolution-gaming/sharding-strategy?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=evolution-gaming/sharding-strategy\u0026amp;utm_campaign=Badge_Grade)\n[![Version](https://img.shields.io/badge/version-click-blue)](https://evolution.jfrog.io/artifactory/api/search/latestVersion?g=com.evolutiongaming\u0026a=sharding-strategy_2.13\u0026repos=public)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellowgreen.svg)](https://opensource.org/licenses/MIT)\n\nAlternative to [akka.cluster.sharding.ShardCoordinator.ShardAllocationStrategy](https://github.com/akka/akka/blob/master/akka-cluster-sharding/src/main/scala/akka/cluster/sharding/ShardCoordinator.scala#L72)\n\n## Api\n\n```scala\ntrait ShardingStrategy[F[_]] {\n\n  def allocate(requester: Region, shard: Shard, current: Allocation): F[Option[Region]]\n\n  def rebalance(current: Allocation, inProgress: Set[Shard]): F[List[Shard]]\n}\n```\n\n## Syntax\n\n```scala\nval strategy = LeastShardsStrategy()\n  .filterShards(...)\n  .filterRegions(...)\n  .rebalanceThreshold(10)\n  .takeShards(10) \n  .shardRebalanceCooldown(1.minute)\n  .logging(...)\n  .toAllocationStrategy()\n```\n\n## Setup\nFor **cats-effect-3**\n```scala\naddSbtPlugin(\"com.evolution\" % \"sbt-artifactory-plugin\" % \"0.0.2\")\n\nlibraryDependencies += \"com.evolutiongaming\" %% \"sharding-strategy\" % \"2.0.0\"\n```\nFor **cats-effect-2**\n```scala\naddSbtPlugin(\"com.evolution\" % \"sbt-artifactory-plugin\" % \"0.0.2\")\n\nlibraryDependencies += \"com.evolutiongaming\" %% \"sharding-strategy\" % \"1.0.7\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevolution-gaming%2Fsharding-strategy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevolution-gaming%2Fsharding-strategy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevolution-gaming%2Fsharding-strategy/lists"}