gfodor / p2pcf

Low cost, low effort P2P WebRTC serverless signalling using Cloudflare Workers
MIT License
952 stars 53 forks source link

Using KV instead of R2 #4

Closed Saiv46 closed 2 years ago

Saiv46 commented 2 years ago

I can't get it. Why would you use R2 while it's in beta and have stricter limits than KV. It's also a overkill for storing a bunch of JSON

gfodor commented 2 years ago

I built this first using KV, but it doesn’t work because of eventual consistency. The delays for the writes to propagate can be up to 10s, so negotiations can take 30s or more, resulting in ICE timeouts and a poor user experience.

Saiv46 commented 2 years ago

Didn't R2 have same problem? As I know, that storage is distributed too.

For consistency - Durable Objects is intended, with timeout of 30s its enough to be used without any storage

gfodor commented 2 years ago

No, R2 doesn’t have this problem. It is strongly consistent storage with global read after write semantics.

On Thu, Aug 4, 2022 at 5:48 AM Alexander Ivanov @.***> wrote:

Didn't R2 have same problem? As I know, that storage is distributed too.

For consistency - Durable Objects is intended, with timeout of 30s its enough to be used without any storage

— Reply to this email directly, view it on GitHub https://github.com/gfodor/p2pcf/issues/4#issuecomment-1205436666, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABVW5CNKC6FAK5MBPPJE33VXPQ57ANCNFSM55DHFGCA . You are receiving this because you commented.Message ID: @.***>

gfodor commented 2 years ago

Re: durable objects I’d be interested in an analysis that showed it would be cheaper. As it is, R2 works great and is very cheap.

On Thu, Aug 4, 2022 at 7:00 AM Greg Fodor @.***> wrote:

No, R2 doesn’t have this problem. It is strongly consistent storage with global read after write semantics.

On Thu, Aug 4, 2022 at 5:48 AM Alexander Ivanov @.***> wrote:

Didn't R2 have same problem? As I know, that storage is distributed too.

For consistency - Durable Objects is intended, with timeout of 30s its enough to be used without any storage

— Reply to this email directly, view it on GitHub https://github.com/gfodor/p2pcf/issues/4#issuecomment-1205436666, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABVW5CNKC6FAK5MBPPJE33VXPQ57ANCNFSM55DHFGCA . You are receiving this because you commented.Message ID: @.***>