Brett Willis
Brett Willis
CDCloudflare Developers
Created by Brett Willis on 5/16/2024 in #workers-help
Smart Placement "too smart"?
The docs https://developers.cloudflare.com/workers/configuration/smart-placement/#unsupported-back-end-services mention that smart placement is not supported for globally distributed services, and specifically mentions Google APIs. If I'm connecting to a Cloud Firestore database in a specific region via the Cloud Firestore REST API, will smart placement ignore this? The Firestore database is always located in a specific region. Also based on the following:
If your Worker does less than one subrequest on average, Smart Placement will run the Worker at the data center closest to the user.
Any application has some routes that require multiple round trips to a database, and some routes that do not touch a database (may serve from cache etc, or reach other backends in different regions). Depending on varying usage statistics, what if the routes that do not hit the database have higher usage than the routes that do hit the database... will this cause Smart Placement to run the worker at a data centre that is far from the database, causing a big latency hit for those routes that have multiple round trips to the database? And this could change any day depending on usage statistics of different routes? As a developer I'm wondering if smart placement would be too smart for it's own good. I know where my backend services are located and I'd prefer to tell Workers where to run rather than wondering how request statistics might be affecting the application latency. I'd prefer to say "just locate the Worker here, or fall back to nearby region if that region is down".
3 replies