devsisters / shardcake

Sharding and location transparency for Scala
https://devsisters.github.io/shardcake/
Apache License 2.0
382 stars 29 forks source link

How to register an entity to only some specific pods #130

Closed BaekGeunYoung closed 1 month ago

BaekGeunYoung commented 1 month ago

There is a main application which hosts entity A, B, C. And I made a specific entity D, and I want to make a separate application which hosts entity D only. I want this architecture to separate traffic regarding to entity D with usual traffic. How can I achieve this?

ghostdogpr commented 1 month ago

Are A, B, C, D entities or entity types? Not sure if you want to separate a particular ID (entity) or group of entities (entity type)?

BaekGeunYoung commented 1 month ago

I mean entity type.

ghostdogpr commented 1 month ago

So currently the Shard Manager does not support different "roles", so all entities go to all pods that have registered to the Shard Manager.

The workaround for that is to use a different Shard Manager instance for your specific entity type D, and have those special pods register to that Shard Manager instance. It works well as long as entity types are on completely separated pods.