Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Is there are way to set service dependencies #947

Open
jkears opened this issue Feb 17, 2021 · 7 comments
Open

Is there are way to set service dependencies #947

jkears opened this issue Feb 17, 2021 · 7 comments

Comments

@jkears
Copy link

jkears commented Feb 17, 2021

Within Docker compose we can set service dependencies to control start-up order.
Is that something that is also available in Tye.yaml?

@davidfowl
Copy link
Member

Nope we discussed it but why do you need it?

@gterdem
Copy link

gterdem commented Feb 24, 2021

@davidfowl I think it is a common scenario where an application service is depend on to an infrastructure service (redis, rabbitmq, mongodb, sqlserver etc) so the infrastructure should be guaranteed to run before app services.

Since there is no way to start/stop/restart individual services (oh there is already a PR #948 about it happens to be waiting your review 😜) it will be hard to master the chaos.

@jkears
Copy link
Author

jkears commented Feb 25, 2021

@davidfowl I have a start-up scenario in which service A sends across registration-type data to secondary service. I currently have this handled via a strong-consistency operation using intra-service communication. It is possible to instead follow an eventual consistency pattern through event notification however my original thought was that if any registration operation failed, we would fail the service which would see it recycled and thus inherently retry as many times as would be necessary to complete the work. The registration data in this case is Business Rule Definitions per each domain command. The secondary service provides a centralized query point for authoring business rules for any command and any service. The actual business rules are stored within each service but are also added/updated or deleted on the secondary service so they can be easily queried for editing.

At a very high-level Service A/B will create Business Rule Definitions saved locally within the service and as well sent across into the Domain Rules service within a back-ground task shortly after start-up.

image

@davidfowl
Copy link
Member

The reason we didn't do dependencies and startup order is because we didn't think it would be replicated in the production environments so giving people that false sense that it works locally is bad.

@jkears
Copy link
Author

jkears commented Feb 25, 2021

I suppose that somewhat makes sense.
Either way, we have many ways to get around this so personally I am not all that fused.

More importantly, we are way more productive having Tye and Dapr than without, and so for that, many thanks!

Tye & Dapr Rock!

@ThomasSkyldahl
Copy link

Sorry for bumping the issue, but another great benefit for dependencies would be to enable starting single or multiple services and their dependencies
something like
tye run --services catalogservice,orderservice

this would bring up the two services and their dependencies

@NMillard
Copy link

NMillard commented Jan 5, 2023

@davidfowl I guess that makes sense to not give the wrong impression.

I'm thinking that dependencies allow one to emulate what's in production since we'd expect a few services to already exist such as a database, rabbitmq, etc.

Not having the opportunity to do dependencies makes the application restart until the service is available, which is a bit annoying.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants