I am planning to deploy a GraphQL API server instance on Cloud Run? Any pros and cons to it? What is an ideal production grade deployment option on GCP for Apollo GraphQL API server?
Solved! Go to Solution.
Hi @dheerajpanyam,
Using Cloud Run is actually suitable for your use-case and it’s well-designed for GraphQL API because its advantage is highlighted in terms of scalability, pay-per-use pricing, statelessness that makes portability possible, easiness in version control and rollbacks; and an option to use custom domain mapping and SSL.
One of the disadvantages is that cold starts can happen in Cloud Run that require certain best practices to mitigate such behavior. One can only reduce this from happening, but never totally eliminate its probability. Second, due to its stateless nature, all persistent data is recommended to be stored in external Google Cloud services so you can’t solely rely on the instance’s local storage and memory. Lastly you also need to consider its quotas and limitations.
Other than Cloud Run, one alternative to consider is by using Google Kubernetes Engine. It has more advantages than Cloud Run in terms of better flexibility and control. The only downside of this is that it requires additional efforts for managing containers and other operational workloads, but for complex deployments that require customized configuration under networking, security and resource allocation, this is preferable. Take note that deploying your GraphQL API server on GKE is more expensive than doing so on Cloud Run but it’s still worth exploring in case you’re interested.
In my opinion, my overall recommendation here is to still consider using Cloud Run as your main deployment option.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Hi @dheerajpanyam,
Using Cloud Run is actually suitable for your use-case and it’s well-designed for GraphQL API because its advantage is highlighted in terms of scalability, pay-per-use pricing, statelessness that makes portability possible, easiness in version control and rollbacks; and an option to use custom domain mapping and SSL.
One of the disadvantages is that cold starts can happen in Cloud Run that require certain best practices to mitigate such behavior. One can only reduce this from happening, but never totally eliminate its probability. Second, due to its stateless nature, all persistent data is recommended to be stored in external Google Cloud services so you can’t solely rely on the instance’s local storage and memory. Lastly you also need to consider its quotas and limitations.
Other than Cloud Run, one alternative to consider is by using Google Kubernetes Engine. It has more advantages than Cloud Run in terms of better flexibility and control. The only downside of this is that it requires additional efforts for managing containers and other operational workloads, but for complex deployments that require customized configuration under networking, security and resource allocation, this is preferable. Take note that deploying your GraphQL API server on GKE is more expensive than doing so on Cloud Run but it’s still worth exploring in case you’re interested.
In my opinion, my overall recommendation here is to still consider using Cloud Run as your main deployment option.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.