feat: regional replication for sharded tag cache#500
feat: regional replication for sharded tag cache#500conico974 merged 5 commits intoopennextjs:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 0320485 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
| return regionalReplicasInAllRegions; | ||
| } | ||
|
|
||
| getClosestRegion() { |
There was a problem hiding this comment.
We could get better accuracy on this one by using country or colo if needed
5c14d74 to
02b441f
Compare
| * Default region to use for the regional replication when the region cannot be determined | ||
| * @default "enam" | ||
| */ | ||
| defaultRegion?: AllowedDurableObjectRegion; |
There was a problem hiding this comment.
Should this also be used when enableRegionalReplication is false?
At least it would be nice to clarify the comment on when exactly this is used.
If we decide to use it only when enableRegionalReplication is true then we can use
regionalReplicationOptions?: {
defaultRegion: AllowedDurableObjectRegion
}to be consistent with shardReplicationOptions
There was a problem hiding this comment.
I've decided to go with the regionalReplicationOptions params to keep it consistent
02b441f to
ad3e971
Compare
|
Doc PR: opennextjs/docs#155 |
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "@opennextjs/cloudflare": patch | |||
There was a problem hiding this comment.
| "@opennextjs/cloudflare": patch | |
| "@opennextjs/cloudflare": minor |
| * | ||
| * This will increase the number of durable objects created, as each shard will be replicated in all regions. | ||
| */ | ||
| regionalReplicationOptions?: { |
There was a problem hiding this comment.
I feel like we do not really need "Options"?
| regionalReplicationOptions?: { | |
| regionalReplication?: { |
vicb
left a comment
There was a problem hiding this comment.
LGTM, thanks.
A couple minor comments
This PR adds yet another layer of replication for the sharded tag cache, this time aiming at reducing the latency worldwide by replicating the data tag in multiple regions