specific placement
Instead of smart placement, for governance purposes, how can I run a worker in my location of choice.
Use case: I need to check uptime of other systems, and gather app info, but it has to be from a specfic region.
So not smart-placement, by my-placement.
9 Replies
For "governance" purposes you say, like needing to follow data residency/processing laws?
Durable Objects support two jurisdictions: https://developers.cloudflare.com/durable-objects/reference/data-location/
EU and Fedramp, but:
Your Workers may still access Durable Objects constrained to a jurisdiction from anywhere in the world. The jurisdiction constraint only controls where the Durable Object itself runs and persists data. Consider using Regional Services to control the regions from which Cloudflare responds to requests.You could use them to make fetch requests Cloudflare has a whole suite of data localization stuff for meeting those legal requirements, which can restrict where Workers themselves run even, the cdn, etc : https://developers.cloudflare.com/data-localization/ All Enterprise though. There are less guaranteed options like Durable Object location hints for specific regions, or using Smart Placement bound to a D1 DB to force a specific location, but those are "loose" and not what you'd want if you need to follow specific requirements exactly
Thx, seems like I could get away by creating the DO in the right region.
It still means then firing up a small Fly.io server in the right region to initiate the request.
It’s not as much governance as it is practical requirement.
We have many cloud services running in various countries, and testing endpoint uptime makes only sense if the uptime check is done from the same country/region.
Eg: node ping test our Australian endpoints, but it does it from Finland, which makes no sense. The Aussie apps are only used by Aussie customers, and there fore we want to test it only from that region.
There are things like international latency and connectivity issues which we want to avoid.
Thx, seems like I could get away by creating the DO in the right region. It still means then firing up a small Fly.io server in the right region to initiate the request.Durable Objects support region location hints on creation: https://developers.cloudflare.com/durable-objects/reference/data-location/#provide-a-location-hint I have a monitoring setup using exactly those and it works fine
Eg: node ping test our Australian endpoints, but it does it from Finland, which makes no sense. The Aussie apps are only used by Aussie customers, and there fore we want to test it only from that region.However.. not all locations support Durable Objects. Durable Objects require a decent amount of capacity and multiple nearby colos to accept the writes to support failover and such. All Durable Objects created in Australia would go to Singapore or Tokyo: https://where.durableobjects.live/colo/CBR/ There's no DO support in Africa or South America either
but https://developers.cloudflare.com/durable-objects/reference/data-location/#provide-a-location-hint
a afr and sam suggestion for DO locations?
What's the point of suggesting afr if it's going to end up in where? Europe?
Cloudflare Docs
Data location · Cloudflare Durable Objects docs
You can restrict a Durable Object to a jurisdiction, or provide a location hint.
That website built by the community allows you to see. Yes, Africa does go to Europe: https://where.durableobjects.live/colo/JNB
What's the point of suggesting afr if it's going to end up in where? Europe?Location hints are just that "hints", not guarantees. They were talking about adding Durable Objects to South America in the near future. Durable Objects are the building blocks for a lot of things. They back R2 Metadata, D1 DBs, etc, so CF wants to expand them more
Where Durable Objects Live
Johannesburg, South Africa(colo) | Where Durable Objects Live
Tracking where Durable Objects are created, wherever you are in the world.
thx, so that nullify my whole idea. If Iam to test url uptime and response times for Aus and South Africa.. It will be meaningless, since it will come from another continent.
for now I'll stick to my fly.io servers which I can pick where to deploy.
If you specifically need those locations, yea at the moment it wouldn't be possible. imo CF's whole nature is kind of against the idea of forcing specific regions, as they have limited capacity/only capacity where they need it, and while using Durable Object are cool way around it, they have their own designed use case where they need to be, well, Durable, which requires lots of nearby capacity/failover/etc. Every time you do a write in a DO, it has to be confirmed by multiple separate locations which could be used as failover/need low latency. Singapore for example is 9 specific colocations composing it, some in different physical DCs I imagine.
We've made suggestions to CF before to extend Smart Placement further to something like manual placement, we'll have to see though
thx, yes.. I'm probably trying a wrong use case. The durability in understandable. It would be great it was possible to simply start a worker in a location. Since the concept of a worker is to do some work.. and often that is locally. Cloudflare workers are more designed for end user apis to some form of backend storage, and it seem they assume to choose for you is better. Maybe workers vs background workers concept needs to be tought of. However, you said it's available in enterprise. I'll need to dig.
Well Enterprise allows you to force an entire zone/website to only run in a specific region: https://developers.cloudflare.com/data-localization/regional-services/
This changes where Workers run just by the nature of it