I had a scenario with me, in which I have microser...
# general
s
I had a scenario with me, in which I have microservices A and B (both are multi pod deployments), A does some computation and updates its database, then it needs to let all the pods of B know about the updates, which are some basic configs. how can this be done so the system is scalable? and I don't want service B to use much resources coz it is already resource constrained... I have checked the following approaches which are allowed in my company: 1. through kafka: all pods of service B will have a different consumer group, and they all subscribe to the same topic into which A would push its updates 2. through pulsar: similar to kafka, and I also got to know that pulsar is more suitable for these kinds of fan out scenarios. how exactly I so have some idea, but don't know this exactly 3. through zookeeper: this is more preferred by my seniors who have some experience using it. They have claimed that the approach using zk would use the least resources, and would suit for usage in service B. which approach should I use given the constraints? and if pulsar, then how exactly is its subscription model better than kafka?
a
Depending on your needs Zookeeper could be nice. For Pulsar if you check the subscriptions you can see the solution for your case here: > • If you want to achieve traditional "fan-out pub-sub messaging" among consumers, specify a unique subscription name for each consumer. It is an exclusive subscription type.
l
then how exactly is its subscription model better than kafka?
One of the main differentiators is per-message acknowledgments which enables different type of use cases and a lot more flexibility. For example, this webinar recording contains a lot of information about this:

https://www.youtube.com/watch?v=OknpSoT5zYQ▾

. There's also a real world success story there.
🙌 1
s
ok guys, thanks for this. will dig in and analyse further. this was quite to the point. 🙏
d
It sounds like you are trying to implement a selective broadcast pattern, where microservice A broadcasts a single event to a subset of microservices that have registered interest. Is my understanding correct?
s
no it has to broadcast to all pods of microservice B, not selective
d
Sorry, by selective I meant, broadcast to microservice B, but not C and D.