Best practice for creating multiple lightweight Google Cloud Functions?

前端 未结 2 556
一整个雨季
一整个雨季 2020-12-31 19:27

The way it seems Google Cloud Functions works is by:

  • your modules go inside a functions directory
  • that functions directory t
2条回答
  •  自闭症患者
    2020-12-31 19:50

    I'm using modofun (https://modofun.js.org), which is a router for multiple operations based on the request path. This allows me to gather related functions into a module that's deployed as a single Google Cloud Function. The dependencies for all functions in that module are the same, so that makes it dependency-efficient. And you can also share common global resources, like database connections.

    I agree that deploying every single function on its own is a waste of resources, and it's very hard to maintain.

    I did this for a Google Cloud Functions deployment I have in production.

提交回复
热议问题