Omer Naveed
Omer Naveed

Reputation: 25

Firebase Cloud Functions - serving multiple users at once

I'm creating a Firebase function that grabs images from a webpage that the user specifies. My current implementation downloads the images using axios and saves them using fs to the local function project directory. I have only been able to test the function locally, so I'm not sure how it will work in production.

Since I have the files saved locally, what happens if multiple users call the function at the same time with different webpages? Will the files overwrite each other?

Thanks

Upvotes: 1

Views: 200

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 599401

Since I have the files saved locally, what happens if multiple users call the function at the same time with different webpages? Will the files overwrite each other?

Parallel invocations will run on separate instances. Cloud Functions automatically creates as many instances as needed, and scales back down when load decreases.

Upvotes: 1

Related Questions