Quantcast

Multiple parents supported?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Multiple parents supported?

tsukit
I'm reading about the parent/child relationship between entities. The document on static model states you can specify a parent. I wonder if it supports multiple parents.

For example, I could define a web app, mongos (MongoDB), and tomcat to be deployed on a machine. The parents of the web app are tomcat and mongos. Supposedly both mongos and tomcat have to be deployed first, then the web app.

The "parent" property seems to be just a string. How can I specify multiple parents? Does it suppport multiple parents at all?

Thanks,
Ed
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple parents supported?

frenchyan
Administrator
No multiple parents are not supported. The parent/child relationship has been designed for container/contained relationship. Example: the web app (=child / contained) needs to be deployed in tomcat (= parent / container). From a logical point of view, the web app cannot leave on its own: it needs a container to be deployed in => hence the tight parent/child relationship. 

There is no parent/child relationship between a web app and mongoDB. I believe you are thinking more in terms of dependency, as in your web app requires the DB to run. glu does not support expressing a dependency like this. This has been a design choice as your application should not depend on the DB to always be up: there will be times when the web app will be up but the DB will be down or vice versa (which cannot happen in the case tomcat / web app: the web app cannot be up if tomcat is not up...). So your app needs to handle the cases when the db is up or down properly.

There is a feature request for adding this: https://github.com/pongasoft/glu/issues/168 but it has never been implemented as of now.

I do understand the requirements, but I still believe your app should be able to handle up/down at the db level as one day or another it will happen.

Yan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple parents supported?

tsukit
You're correct that what I meant is all about dependencies and I thought that the parent setting is for this purpose. If there is direct support for this, it would be awesome as there will be cases where single parent isn't enough. For example, when I take down Mongo for upgrade, I would also want to have all dependent web app running against it down automatically as well. Sure, it can be argued that doesn't have to be the case, but I think you get the point.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple parents supported?

frenchyan
Administrator
Yes I do and that is the reason why there is the ticket :)

Yan
Loading...