[Durable Objects] Add documentation for gradual deployments for Durable Objects.#13564
[Durable Objects] Add documentation for gradual deployments for Durable Objects.#13564jp4a50 merged 7 commits intoproductionfrom
Conversation
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
| - For a given deployment, requests to each Durable Object will always use the same Worker version. | ||
| - When you specify each version in the same order as the previous deployment and increase the percentage of a version, Durable Objects which were previously assigned that version will not be assigned a different version. In our example, Durable Object "foo" would never revert from version "B" to version "A". | ||
| - The Durable Object will only be [reset](/durable-objects/reference/troubleshooting/#durable-object-reset-because-its-code-was-updated) when it is assigned a different version, so each Durable Object will only be reset once in our example. | ||
|
|
There was a problem hiding this comment.
Should we add a bullet for Websockets not being disconnected with gradual rollouts? I believe we can't remove https://github.com/cloudflare/cloudflare-docs/blob/production/content/durable-objects/reference/websockets.md?plain=1#L23 just yet
There was a problem hiding this comment.
Websockets will still be disconnected whenever a specific Durable Object's code is updated. The difference is that a gradual deployment may only update the code for a subset of DOs now, so only websockets to those DOs will be disconnected.
I think ideally we should have a dedicated section on Durable Object resets which defines when they happen and their side effects (e.g. websockets being disconnected) and both the above documentation and the documentation in your link should reference that.
What d'you think?
There was a problem hiding this comment.
Makes sense, I'll track the DO reset behavior docs.
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
| ``` | ||
| You should see 10 responses. Responses will reflect the content returned by the versions in your deployment. Responses will vary depending on the percentages configured in step #6. | ||
|
|
||
| ## Gradual deployments for Durable Objects |
There was a problem hiding this comment.
I would love see a section that directly addresses forwards and backwards compatibility requirements between eyeball Worker and Durable Objects during a release (old eyeball talks to new DO and new eyeball talks to old DO).
If this is already mentioned elsewhere outside of gradual deployments page (if not, I think it should be), this could be as simple as a link and mentioning that this easily missed compatibility issue will be exacerbated with gradual deployments.
There was a problem hiding this comment.
Good call. The requirement for forwards and backwards compatibility for durable objects and the worker that talks to them is briefly mentioned here so I will link to that for now and elaborate on how gradual deployments affects this problem.
I think we could generally do with a section explaining compatibility requirements more generally. I started drafting a new section in the "Versions & Deployments" page that was added in @tanushree-sharma 's PR but it's tricky to explain this in general terms without introducing new terminology and/or using diagrams/example code so I'll leave that for another time.
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
Deploying cloudflare-docs with
|
| Latest commit: |
be02af1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://610e40ea.cloudflare-docs-7ou.pages.dev |
| Branch Preview URL: | https://jphillips-do-gradual-deploym.cloudflare-docs-7ou.pages.dev |
irvinebroque
left a comment
There was a problem hiding this comment.
Merge conflicts then 🚀
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
|
|
||
| Typically, your Durable Object Worker will define both your Durable Object class and the Worker that interacts with it. In this case, you cannot deploy changes to your Durable Object and its Worker independently. | ||
|
|
||
| [You are advised](/durable-objects/platform/known-issues/#code-updates) to ensure that API changes between your Durable Object and its Worker are forwards and backwards compatible whether you are using gradual deployments or not. However, using gradual deployments will make it even more likely that different versions of your Durable Objects and its Worker will interact with each other. |
There was a problem hiding this comment.
| [You are advised](/durable-objects/platform/known-issues/#code-updates) to ensure that API changes between your Durable Object and its Worker are forwards and backwards compatible whether you are using gradual deployments or not. However, using gradual deployments will make it even more likely that different versions of your Durable Objects and its Worker will interact with each other. | |
| [You should](/durable-objects/platform/known-issues/#code-updates) ensure that API changes between your Durable Object and its Worker are forwards and backwards compatible, regardless of whether you are using gradual deployments or not. However, using gradual deployments will make it even more likely that different versions of your Durable Objects and its Worker will interact with each other. |
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
c06d7d2 to
795c5db
Compare
Yep, it was because I originally targeted the branch used for #13429 which was squashed, merged and deleted. I've rebased now. This PR is ready to merge now as far as I'm concerned. |
| ## Code updates | ||
|
|
||
| Code changes for Workers and Durable Objects are released globally in an eventually consistent manner. Because each Durable Object is globally unique, the situation can arise that a request arrives to the latest version of your Worker (running in one part of the world), which then calls to a unique Durable Object running the previous version of your code for a short period of time (typically seconds to minutes). | ||
| Code changes for Workers and Durable Objects are released globally in an eventually consistent manner. Because each Durable Object is globally unique, the situation can arise that a request arrives to the latest version of your Worker (running in one part of the world), which then calls to a unique Durable Object running the previous version of your code for a short period of time. If you create a [gradual deployment](/workers/configuration/versions-and-deployments/gradual-deployments/), this period of time is determined by however long your live deployment is configured to use more than one version. |
There was a problem hiding this comment.
Probably keep the "typiccally seconds to minutes" piece for the base case scenario
| @@ -0,0 +1,13 @@ | |||
| --- | |||
| pcx_content_type: navigation | |||
| title: Gradual Deployments | |||
There was a problem hiding this comment.
| title: Gradual Deployments | |
| title: Gradual deployments |
There was a problem hiding this comment.
We usually capitalize Deployments elsewhere so leaving as-is.
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
|
|
||
| Imagine that you have previously created 3 Durable Objects, [deriving their IDs from the names](/durable-objects/configuration/access-durable-object-from-a-worker/#derive-ids-from-names) "foo", "bar" and "baz". | ||
|
|
||
| Your Worker is currently on a version that we will call version "A" and you want to gradually deploy a new version "B" of your Worker. |
There was a problem hiding this comment.
| Your Worker is currently on a version that we will call version "A" and you want to gradually deploy a new version "B" of your Worker. | |
| Your Worker is currently on a version called version "A" and you want to gradually deploy a new version "B" of your Worker. |
There was a problem hiding this comment.
I'd like to leave this phrasing as-is to convey that this is just a made-up identifier, rather than the actual version ID.
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
content/workers/configuration/versions-and-deployments/gradual-deployments.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Maddy <130055405+Maddy-Cloudflare@users.noreply.github.com>
| title: Gradual Deployments | ||
| weight: 25 | ||
|
|
||
| external_link: /workers/configuration/versions-and-deployments/gradual-deployments/#gradual-deployments-for-durable-objects |
There was a problem hiding this comment.
adding this in DO docs was nice touch
…le Objects. (#13564) * Add documentation for gradual deployments for Durable Objects. * Address code review comments. * Make Durable Objects gradual deployments example more concise. * Fix broken links. * Minor code review. * add diagram and link * Apply suggestions from code review Co-authored-by: Maddy <130055405+Maddy-Cloudflare@users.noreply.github.com> --------- Co-authored-by: Tanushree Sharma <tanushree@cloudflare.com> Co-authored-by: Maddy <130055405+Maddy-Cloudflare@users.noreply.github.com>
No description provided.