Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📖 Docs PR preview links
|
flippedcoder
left a comment
There was a problem hiding this comment.
Just a couple of small things to consider!
| layers that handle different concerns: | ||
|
|
||
| <CaptionedImage | ||
| src="/diagrams/data-converter-flow-with-external-storage.svg" |
There was a problem hiding this comment.
switched to themed images. i think maybe after this PR i will just update our captioned images component to have a dark/light theme
| @@ -0,0 +1,315 @@ | |||
| --- | |||
| id: large-payload-storage | |||
There was a problem hiding this comment.
Could the id be changed to external-storage to match the page title? Maybe external-storage-aws if the other cloud platforms are coming later.
docs/develop/go/best-practices/data-handling/large-payload-storage.mdx
Outdated
Show resolved
Hide resolved
…mentation into large-payload-go
| ```go | ||
| import ( | ||
| "github.com/aws/aws-sdk-go-v2/config" | ||
| awss3 "github.com/aws/aws-sdk-go-v2/service/s3" |
There was a problem hiding this comment.
Any particular reason why you aliased the import to awss3 instead of just using the default and calling s3.NewFromConfig?
| <!--SNIPEND--> | ||
|
|
||
| By default, payloads larger than 256 KiB are offloaded to external storage. You can adjust this with the | ||
| `PayloadSizeThreshold` option, even setting it to 0 to externalize all payloads regardless of size. Refer to |
There was a problem hiding this comment.
| `PayloadSizeThreshold` option, even setting it to 0 to externalize all payloads regardless of size. Refer to | |
| `PayloadSizeThreshold` option, even setting it to 1 to externalize all payloads regardless of size. Refer to |
The minimum value for externalizing all payloads in the Go SDK is 1. That is because the construction of the ExternalStorage struct already has this field set to 0. We interpret 0 to mean the default value.
|
|
||
| - `Name()` returns a unique string that identifies the driver instance. The SDK stores this name in the claim check | ||
| reference so it can route retrieval requests to the correct driver. Changing the name after payloads have been stored | ||
| breaks retrieval. For example, two S3 drivers could be named `"s3-us-east"` and `"s3-eu-west"`. |
There was a problem hiding this comment.
Not sure that drivers would actually be named after the region that they might be targeting. Maybe they'd be named for why they are stored differently.
| reference so it can route retrieval requests to the correct driver. Changing the name after payloads have been stored | ||
| breaks retrieval. For example, two S3 drivers could be named `"s3-us-east"` and `"s3-eu-west"`. | ||
| - `Type()` returns a string that identifies the driver implementation. Unlike `Name()`, this must be the same across all | ||
| instances of the same driver type regardless of configuration. Both S3 drivers in the example above would return |
There was a problem hiding this comment.
Both S3 drivers in the example above would return
"aws.s3driver"as their type.
Only the example at the top of the page would return this. The sample driver you wrote just above this would return local-disk.
There was a problem hiding this comment.
was referring the example in text s3-us-east etc, but will clarify here
| storeDir string | ||
| } | ||
|
|
||
| func NewLocalDiskStorageDriver(storeDir string) *LocalDiskStorageDriver { |
There was a problem hiding this comment.
Probably better to return StorageDriver instead of *LocalDiskStorageDriver.
| ## Configure payload size threshold | ||
|
|
||
| You can configure the payload size threshold that triggers external storage. By default, payloads larger than 256 KiB | ||
| are offloaded to external storage. You can adjust this with the `PayloadSizeThreshold` option, or set it to 0 to |
There was a problem hiding this comment.
Same comment about how 1 is the minimum for externalizing all payloads in Go.
| c, err := client.Dial(client.Options{ | ||
| ExternalStorage: converter.ExternalStorage{ | ||
| Drivers: []converter.StorageDriver{driver}, | ||
| PayloadSizeThreshold: 0, |
There was a problem hiding this comment.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
drewhoskins-temporal
left a comment
There was a problem hiding this comment.
approved but please look at my comments either here or in a followup PR.
|
|
||
| ### 4. Configure the Client | ||
|
|
||
| Pass an `ExternalStorage` struct with your driver in the Client options: |
There was a problem hiding this comment.
Call out/link out to plugins here as well.
| - Go SDK | ||
| - Temporal SDKs | ||
| - Data Converters |
There was a problem hiding this comment.
did you intentionally include fewer tags/keywords here than in the encyclopedia?
| ## Use multiple storage drivers | ||
|
|
||
| When you register multiple drivers, you must provide a `DriverSelector` that implements the `StorageDriverSelector` | ||
| interface. The SDK returns an error at client creation if multiple drivers are registered without a selector. The |
There was a problem hiding this comment.
nit: There's no need to point out the error, especially at a moment when we're just trying to figure out what selectors do.
| - Driver migration. Your Worker needs to retrieve payloads created by clients that use a different driver than the | ||
| one you prefer. Register both drivers and use the selector to always pick your preferred driver for new payloads. | ||
| The old driver remains available for retrieving existing claims. | ||
| - Latency vs. durability tradeoffs. Some Workflow types may benefit from a faster storage backend |
There was a problem hiding this comment.
I'm having second thoughts about this. I'm not sure we should recommend a non-durable solution. In fact, it contradicts above where we recommend "In production, use a durable storage system"
There are indeed a few customers who do this, but it feels like very "at your own risk" rather than something we should recommend.
For an alternative, let's do multi-cloud. S3 if you're on AWS , GCS if on gcloud, etc.
| slug: /external-storage | ||
| toc_max_heading_level: 4 | ||
| keywords: | ||
| - external-storage |
There was a problem hiding this comment.
I searched for "Large payloads" and this doc didn't come up. Does it need to be a tag for that to happen?
The main thing that made docs come up was the "#large-payloads" slack channel mention.

What does this PR do?
Notes to reviewers
┆Attachments: EDU-6196 docs: add go docs for payload storage