繁体   English   中英

Cloud Run 中的 Node Js 和存储在 Cloud Storage 中的 Sqlite

[英]Node Js in Cloud Run and Sqlite stored in Cloud Storage

所以我想使用Express创建一个简单的节点 API并使用Sqlite作为数据库。

我想在GCP Cloud Run中托管节点 API,但我无法存储 sqlite 数据库文件。 我首先将 Node JS 应用程序和 Sqlite 文件放在计算引擎的实例中。

But then I though since sqlite only needs the sqlite file to run, I could just host the Node Js API in Cloud Run and store the sqlite database file in Cloud Storage and since the database in not really going to be accessed a lot and have a很多数据。 我 API 仅在每周 5 天 9 到 5 天的工作时间内为我的客户使用3个人。

我想知道这是否可行,以及这是否是最便宜的选择。

不,你不能那样做。 这不是数据库的工作方式。 Sqlite 不仅“需要”数据库文件,还需要一个 proepr 文件系统来提供安全和高性能的读写访问。

您可以尝试将文件存储安装到云运行并在那里安装 sqlite ,这可能最接近您想要的https://cloud.google.com/run/docs/tutorials/network-filesystems-filestore

您最好拥有一个具有应用程序和 sqlite 的实例,或者将您的数据写入云数据库,如谷歌的托管数据库、yugabyte、cockroachdb 等

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM