我应该在Google Cloud Run上运行mysql吗? (或任何数据库) [英] Should I run mysql on google cloud run? (or any database)

查看:130
本文介绍了我应该在Google Cloud Run上运行mysql吗? (或任何数据库)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究在Google Cloud Run中运行Docker容器的新选项,但是,似乎没有关于是否应在Cloud run上运行MySQL的建议,显然,我知道这不是Web服务,而且我在GCP的官方Google文档中了解到,Google可能只是告诉人们请使用Cloud SQL(他们的SQL产品),但我没有在网上找到任何有关在云运行时运行mysql"的建议.我想问一下. 冷启动的启动时间会降低解决方案的性能吗? (假设使用存储桶来存储东西)

I've been researching the new options to run Docker containers in Google Cloud Run, however, there seems to be no advice on whether or not one should run MySQL on Cloud run, apparently, I know it isn't a web service, and I understand in the Official Google Documentation for GCP, Google would probably just tell people to kindly use Cloud SQL (their SQL Offering), I haven't found any advice online about "running mysql on cloud run", so I thought I'd ask here. Will startup times from cold starts decrease performance of the solution? (assuming one uses a Bucket for storing the stuff)

推荐答案

运行SQL数据库不太适合Cloud Run.

Running a SQL database is not a good fit for Cloud Run.

首先,已部署的容器与Cloud Run之间的契约是该容器需要在端口8080上运行HTTP服务器.这并不是MySQL的工作方式.

First of all, the contract between the deployed container and Cloud Run is that the container needs to run an HTTP server on port 8080. That's not really the way MySQL works.

第二,容器将限于容器映像中包含的文件系统.服务处理负载时,将多次实例化同一张图像.将无法持久保存写入MySQL的数据.您可能在该图像中存储了只读数据,这些数据仅在发布新图像时才会更改,但这并不是使用关系数据库的真正目的.

Second of all, the container is going to be limited to the filesystem that was included in the container image. This same image is going to be instantiated many times over as the service handles load. There will be no way to persist the data written to MySQL. You could have read-only data stored in that image that only changes when a new image is published, but that's not really what you would expect to use a relational database for.

Cloud Run确实擅长以无服务器且可扩展的方式操作HTTP/Web服务.这些网络服务通常利用部署到Google Cloud的其他API和服务或第三方服务.并不是要提供持久的,可扩展的,符合ACID的数据库服务-这是一种完全不同的问题空间.

Cloud Run is really good at operating HTTP/web services in a serverless and scalable way. These web services typically make use of other APIs and service deployed to Google Cloud, or third party services. It's not really meant to offer persistent, scalable, ACID-compliant database services - this is a whole different sort of problem space.

这篇关于我应该在Google Cloud Run上运行mysql吗? (或任何数据库)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆