We built an API and integrated cloud function as backend. Till now we were deploying cloud function first and API gateway later. Is there a best way to club these two services and deploy it as a whole?
Asked
Active
Viewed 21 times
0
![](../../users/profiles/8435814.webp)
code tutorial
- 182
- 8
-
Do you want to deploy them in the same time? To release both exactly in the same time? – guillaume blaquiere Apr 27 '21 at 21:34
-
@guillaumeblaquiere yes. Wanted to deploy both at the same time as a microservice – code tutorial Apr 28 '21 at 09:10
1 Answers
1
It's 2 different products and no, you can't tie them and deploy in the same time.
- Cloud Functions build a container based your code and can take more or less time according to the number of dependencies and the type of language (required compilation (Java or Go) or not).
- API Gateway requires to deploy a new config and to deploy it on a gateway. And it takes a while to achieve these.
So, no link between the product and not the same deployment duration. The right pattern here is to use versioning. You can deploy a service before the others (Cloud Functions before API Gateway) for minor change (doesn't break the existing behavior).
For breaking change, I recommend you to not update the existing functions but to create a new one. The advantage is to have the capacity to continue to have the 2 versions in parallel, and a rapid rollback in case of issue. Same thing for API Gateway, create a new gateway for a new version.
![](../../users/profiles/11372593.webp)
guillaume blaquiere
- 33,758
- 2
- 11
- 37