More information about Joyent’s pattern for building self-operating applications:
Notably this pattern applies to stateful applications as well.