Globally distributed serverless functions?

I curious if someone could clarify how the serverless functions will “distributed everywhere”, when Netlify functions are deployed to “us-east-1 AWS Lambda region”.

This is not a critic, I’m just trying to understand :slight_smile:

Best regards
Emil

1 Like

Right now, Netlify does indeed only deploy functions to us-east. This is something we’d love to work with them to improve, making it possible to specify how much global distribution you’d like. Beyond the Lambda functions, though, you need to think about your database as well. If your database is non-distributed and lives in us-east then it makes sense to only deploy your functions there (put your business logic next to your database). In the future, when we get things smoothed out with distributed SQL databases and NoSQL DBs, then it will make sense (under certain circumstances) to have your business logic on the edge as well. We will also be working on deployment strategies for other providers (direct to AWS, Google Cloud, Azure, etc) that will give you total control over everything.

2 Likes

Does anyone have the experience of deploying to Azure Functions? Really appreciate for any guidance on it.:pray:

@andrew-hh

Currently, there are strategies to deploy functions on Netlify, Vercel, and AWS Serverless.

While there is info on how to use Azure’s Postgres and 0.24 supports AzureAD auth (via the msal client or via Superbase), I do not believe someone has jumped in yet to determine how to run functions on Azure.

There have been some early experiments to get functions and the api deployed of Google Cloud.

@kimadeline or @jeliasson do you know of any updates to deploying the API on Azure?

1 Like

Hey @andrew-hh

You might be interested in trying out Azure Static Web Apps (preview) which I believe is a CDN enabled frontend and with Azure Functions for serverless functions. I have just looked at it briefly, as I primarily do serverfull stuff. Maybe @kimadeline can give some insights? :slight_smile:

2 Likes

I curious if someone could clarify how the serverless functions will “distributed everywhere”, when Netlify functions are deployed to “us-east-1 AWS Lambda region”.

@emilr I know this is a bit old of a question, but in general when a a cloud provider talks about geographically distributed compute you generally need to define your location of meta data (name, environment variables, source code etc). This location is ultimately your true source of data and is where the data is propagated from to the edge. Cloud providers will also (in general by default) make sure that your meta data is replicated to near-location data centers in the same region. This allows them to appoint a new meta data location and re-propagate the data to edges in case of disaster recovery.

Having said that, I do not know how Netlify configure and use AWS for their serverless deployments. I would assume by now they have a similar setup described above. I.e that the source of your serverless functions will reside in us-east-1 and have been propagated to edges around the world.

Thank you for the ping @jeliasson! Hi @andrew-hh!

I played with Azure SWA a while ago, but I didn’t go very far with it. Deploying the front-end was pretty seamless, and I could get a basic function to work, sadly I didn’t get to a working RW back-end using Azure Functions :disappointed:

I believe it wasn’t getting compiled properly, so nothing was deployed, and I was investigating whether it was a setup issue, or if I needed to modify code. I should probably dust off this project and give it another try :laughing:

If you do give Azure deployment a try (whether with SWA or Functions), please keep us updated :slight_smile:

Edit: Going to copy my GitHub reply here as well:

if you’re up for some tinkering, the Apollo docs have a section on deployment using Azure Functions, which may be a solid starting point.

2 Likes