Is there any way to implement beehive in hierarchical architecture?
It is straightforward to create logical hierarchies in beehive: You just need to map messages to logically hierarchical keys.
Let say you have a hierarchical network N with two subnets S1 and S2, which with their own subsubnets S11 and S12, and S21 and S22.
If you map messages to hierarchical mapsets:
Message to N => "N"
Message to S1 => "N/S1"
Message to S11 => "N/S1/S11"
...
you will have a bee for each of these networks (ie, N, S1, S11, S12, ...), right? If the bee of N/S1/S11 wants to communicate with its upper layer it emit a message to N/S1, and vice-versa.
I added an reminder to add an example for this:
Implementing Kandoo is even simpler. You can just map local messages to the hive's ID and centralized messages to the same key, say "0". Beehive's TE example is basically Kandoo.
Yes, and we have different tools for that:
1. By default bees are created on the local hive to handle the first message. With that, if a switch connects to hive H1, we'll create a bee on H1. This is how the default placement works.
2. We have the optimizer that tries to optimize the placement of app according to some objective function.
3. For cases where you need an explicit application-defined placement, you can implement your placement logic in a load balancing application, and the real logic in a worker application. The load balancer will receive all messages and decides which worker to forward the message to.
4. On top of these, I'm finalizing a new version of beehive that supports application-defined placement. That change would basically eliminate the need for a load balancer application in most important examples. I'll probably push that version next week.
Cheers,
Soheil