I was just re-reading part of the ZooKeeper documentation and I was
trying to understand why ephemeral znodes should not have children
znodes. Adding this feature, while maintaining an important
restriction, could be really useful.
Let's suppose that we have a multi-agent system and we are using
ZooKeeper to store status for each agent. Most of the time the agent
status can be expressed as a bunch of (key, value) pairs and, because
we can't create children for ephemeral znodes, we need to serialize
this data structure as a byte string. By doing this we make the status
information hard to retrieve and also a bit difficult (and
inefficient) to update.
I believe that it's a good idea to allow the ephemeralOwner session to
create children znodes. By doing this we eliminate the need to
serialize status information.
We should end-up having a tree structure looking like this:
/active -- is active now
/memory -- memory usage for this agent
/ip -- the IP address of the system where the agent is running
/port -- the port where the agent is listening for commands
This is somehow similar to /proc on Unix systems. It shouldn't be that
difficult to cleanup this if the session expires or is closed.
In the near future I would like to use this feature at
http://indekspot.com to publish Apache Solr status information in
order to be able to easily monitor and manage the running servers.
What do you think? Do you find this feature useful?
Andrei Savu -- http://andreisavu.ro