Here's what I'm trying to accomplish
- A visitor lands on my website
- Javascript collects some information and sends a hit
- The hit is processed and inserted into BigQuery
And here's how I have planned to solve it
- The hit is sent to Cloud Functions HTTP trigger (using Ajax)
- Cloud Functions sends a message to Pub/Sub
- Pub/Sub sends data to another Cloud Function using a Pub/Sub trigger
- The second Cloud Function processes the hit into Biguery row and inserts it into BigQuery
Is there a simpler way to solve this?
Some other details to take into account
- There are around 1 million hits a day
- Don't want to use Cloud Dataflow because it inflates the costs
- Can't (probably) skip Pub/Sub because some hits are sent when a person is leaving the site and the request might not have enough time to process everything.