首页 文章

在Google Cloud Platform上运行完全托管,始终可用的node.js脚本

提问于
浏览
0

我是particle.io的忠实粉丝,当他们添加了Google Cloud 平台(GCP)集成时非常兴奋,因此我可以将我的IoT数据保存到GCP“DataStore”中 .

我已经按照他们的教程进行了工作,但是我需要一些关于实现它的建议,以便它可以在GCP上扩展 .

我目前的实现是这样的:https://docs.particle.io/tutorials/integrations/google-cloud-platform/#example-use-cases

基本上我有一个GCP“计算引擎”实例,它运行一个node.js脚本来监听PubSub事件(由我的IoT设备发送)并将其保存到DataStore .

现在因为我希望它可以扩展,理想情况下,此node.js脚本应该在可以自动响应峰值的托管服务上运行 . 但是GCP似乎没有这样的东西 .

在AWS中我可以这样:IoT数据 - > Particle.io AWS WebHook - > AWS API网关 endpoints - > AWS Lambda - > AWS DynamoDB

所有AWS点都受到管理 .

What's the best way to have that node.js script always running in a fully-managed, always-available way on GCP? which can run my node.js script that listens for PubSub events and saves to the DataStore and automatically scales as load increases

任何帮助/建议将不胜感激 .

非常感谢,马克

1 回答

  • 0

    你有很多选择:

    1-正如其他人提到的,有 Cloud 功能 . 它基本上是您部署的Node.js功能,而Google Cloud负责为您扩展/缩小它 .

    2-您可以将Node.js应用程序部署到默认启用了自动缩放功能的App Engine Flex .

    3-如果要继续使用计算引擎,可以在计算引擎上手动设置自动缩放 .

相关问题