Multiple home assistant processes for easy development, better performance, high-availability, etc

While doing some development on Home Assistant, but also working with it in general, I’ve noticed that I often wanted to restart or reload a small portion but keep the rest running. Obviously more extensive configuration reloading could alleviate some of these issues, but I believe allowing for split hass solutions would be a far more versatile and useful solution.

Advantages:

  • Components that accidently block startup wouldn’t hurt the main process anymore (such as: https://github.com/home-assistant/home-assistant/issues/16101)
  • Components that have a long startup time such as the z-wave network (takes about 10 minutes here) can simply keep running while changing configuration. Similarly, services such as evohome which have strict API limits won’t block after a few consecutive restarts.
  • We could have multiple “frontend” hass instances which can keep on running when parts of it fail
  • Restarting for frontend development can be as easy as a quick restart without needing to initialize all components such as discovery
  • Better performance because we can easily utilize multiple processors without having to worry too much about broken components. I mean… ideally we want to fix all of these components but I doubt this list will ever be empty: https://github.com/home-assistant/home-assistant/issues/4210

The downsides:

  • Syncing the state correctly in all cases can be non-trivial. I’m thinking perhaps mqtt could work here? I’ve seen the MQTT statestream and MQTT eventstream but I think they’re lacking a re-init method. So a method to re-send all info might be needed there (or persistent MQTT topics).
  • Locking could be an issue. Some components would not like being initialized multiple times
  • Security? Not sure if MQTT supports any type of security features but that could be a huge problem with that solution for a non-trusted network

Please let me hear your thoughts :slight_smile:

A little bit about me… I’m no Home Assistant expert but I know a thing or two about Python development. I wrote https://www.packtpub.com/application-development/mastering-python

2 Likes