Closed verdie-g closed 7 months ago
Hi @verdie-g, yes, Green/Blue deployments are the same thing as Service Weaver's atomic rollouts, as far as I can tell. If someone comes across this and believes that is not the case, I am interested to hear their perspective.
Orleans supports both Green/Blue and Rolling upgrades.
Green/Blue deployments were more common a decade or so ago, but there are various issues with that approach. For one, it does not dictate how external work is coordinated. For example, if you have a service which is not a stateless request/response RPC service, then there might need to be some coordination for the other work which it performs - such as processing messages from a message queue. Otherwise, you will find that you have multiple services performing the work, unaware of each other, which might produce observably incorrect behavior. A common place people would hit this in Orleans using Green/Blue deployments is with Reminders and with Streams. Rolling deployments solve that issue since you maintain a single logical cluster. The in-built persistence in Orleans at least prevents lost updates in case you have multiple activations of a grain (eg in different clusters), but it's not idea.
Another issue with Green/Blue is that you need to have twice the capacity (1x for the Blue cluster, 1x for the Green cluster) during the rollout and may need to pre-warm the new cluster whenever switching traffic over (it might be best to do this gradually & slowly).
Like so many things, there are trade-offs either way. Rolling deployments require that wire changes are backwards compatible and possibly forwards compatible. Orleans addresses these challenges:
I hope that helps. Apologies for the slow response.
Thanks for that detailed answer.
Are these green/blue drawbacks the reason why it is not more documented/pushed forward for Orleans?
allowing grains to migrate from one host to another when they encounter an incompatible message.
What is an incompatible message for a backward/forward compatible serialization? Can I find some documentation to learn more about that?
Here is some more information: https://learn.microsoft.com/en-us/dotnet/orleans/grains/grain-versioning/grain-versioning
In the paper Towards Modern Development of Cloud Applications by Google that gave birth to Service Weaver, it mentions
Orleans - Server configuration briefly mentions Green/Blue deployments
Does Orleans support atomic rollout through Green/Blue deployments?