Skip to content

Conversation

conico974
Copy link
Collaborator

@conico974 conico974 commented Mar 21, 2025

Implements sharding replication for the Durable Object tag cache.
Instead of being sharded only based on the tag, each shard will now also be replicated
This allow to scale way more (virtually infinitely)
A single tag could be read from any of the N random replicas associated with the tag shard.
On write we still need to write to every single replicas associated with this tag shard

Copy link

changeset-bot bot commented Mar 21, 2025

🦋 Changeset detected

Latest commit: d94c23b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@opennextjs/cloudflare Patch

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

Copy link

pkg-pr-new bot commented Mar 21, 2025

Open in Stackblitz

pnpm add https://pkg.pr.new/@opennextjs/cloudflare@484

commit: d94c23b

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
A few nits related to naming

@conico974 conico974 force-pushed the feat/double-sharding branch from 62994a5 to 0829f86 Compare March 24, 2025 10:23
@conico974 conico974 requested a review from vicb March 24, 2025 14:02
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be careful with naming things correctly to ease later evolutions and maintenance of the code.

I think we have shards, replicas and DOs.

Each shards has a soft and hard variant.
Those variants are replicated to distinct DOs when enableShardReplication is true.

I added a few inline comments, let's iterate.

Thanks!

@conico974 conico974 changed the title Feat double sharding Feat Sharding Replication Mar 24, 2025
@conico974 conico974 requested a review from vicb March 25, 2025 11:14
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks a lot for the updates 🚀

@conico974 conico974 merged commit 6ce5643 into opennextjs:main Mar 25, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants