5
2 Comments

A solution to Cloud Functions Cold Starts

When you are using firestore with cloud functions, most likely you will be facing cold starts more often. It can start from any where in the range of 3-5 secs to massive 15secs.

This is because of the gRpc library initializations with in the standard nodejs firstore libraries (firebase-admin too uses same internally).

Until Google fixes it, one alternative is to use Firestore rest api.

Current solutions like min instances and warming functions won't work if you have more parallel traffic and becomes costly over time.

We recently finished implementing rest based client for node and its fully compatible with existing official module.

We see significant improvements in terms of cold starts and would like to share about the same.

Grab the module from here(https://www.npmjs.com/package/@bountyrush/firestore) and let us know your feedback.

on September 30, 2021
  1. 2

    Nice! A solution could also be using AWS Lambda with Python / JS / Go :D

    1. 2

      hahah roastmode