Jonas Laux
Jonas Laux

Reputation: 449

Google Cloud Functions real-time communication to Client

I have set up a GCloud Function for HTTP Requests to insert some Data/Files into a CloudSQL Postgres DB and the GCloud Storage. When i'm triggering those function, i want to receive an update about the inserting data to all my Clients (React Frontend in Browser). First, i thought of PubSub, but i couldn't find any documentation for the GCloud API to work on the client side. I think, for a Socket Broadcast the GCloud Function lifecycle is too short.

Is there a way to achieve a real-time connection directly to client-side or do i have to take the indirect way first to a backend (to use PubSub) and then to the Frontend?

Also, a few application do rely on the CLoudSQL Postgres DB, so i can't switch to Firebase or some similar Event Database approach.

Upvotes: 1

Views: 357

Answers (1)

Guillermo Cacheda
Guillermo Cacheda

Reputation: 2232

Comment by @FridayPush that answered the question:

Firebase Cloud Messaging, what use to be called GoogleCloudMessages would allow you to alert all clients after an action firebase.google.com/docs/cloud-messaging. This doesn't require a switch of databases to use just a single feature.

Upvotes: 1

Related Questions