I have a fundamental question. How do `dagit` and ...
# ask-community
a
I have a fundamental question. How do
dagit
and
dagster-daemon
sync with each other in case of docker based deployments? If I have
dagit
started in one container and
dagster-daemon
in the other, how does
dagit
know this is the
dagster-daemon
instance it needs to check or the other way around? What happens if I have multiple instances of
dagit
and
dagster-daemon
running in their separate containers, how does it know then which ones are for the same deployment? Does it happen solely by pointing them to the same storage/logs location?
🤖 1
d
Hi Anoop - they communicate through the database, yeah. In a dagster deployment, you can have multiple instances of dagit, but only one dagster-daemon
a
Okay. One of situations I can think of, where multiple dagit instances will be used, is if I have multiple repositories and want to keep them in isolated dagit environments. In such a case, if there is only one dagster-daemon instance, which repository will it pickup the schedule from?
d
the daemon takes in a workspace.yaml file which tells it where to find the code that it should use. Generally I think we assume that you have a single workspace.yaml that applies to all dagits and also to the daemon
a
But if I have multiple dagit instances, I'd probably have different location for the databases/logs for the two, right? Which one would the daemon communicate with in that case?
d
in that case you'd need one daemon for each dagit instance as well - the daemon needs to have a single database to talk to. It sounds like what you're describing is multiple independent deployments of dagster
this is something we have built-in support for in our cloud product, incidentally (having multiple independent deployments of dagster for an organization): https://docs.dagster.cloud/guides/managing-deployments#managing-deployments - in open source dagster, having a setup like that requires hosting multiple independent dagits/daemons/storages
plus1 1
a
That makes sense. Yeah. Just wanted to understand how the two communicated so that even if the deployments are in same machine network, it doesn't create an issue.
👍 1