TrafficAnalysis proxy and Tinybird Integration - multisite setup

Hi,

I’ve been experimenting with TrafficAnalysis proxy, Tinybird, and Ghost CLI to understand how everything works together.

I was able to successfully run a Ghost instance via the standard Ghost CLI, integrated with TrafficAnalysis proxy and Tinybird cloud account.

I configured Tinybird manually - hopefully correctly. Here’s a short summary of the steps I followed:

#Install tinybird CLI

npm install -g @tinybird/cli
 tb login

# Deploy Tinybird schema (from the Ghost install)

tb --cloud deploy /path/to/ghost/core/server/data/tinybird

# Configure TrafficAnalysis .env

TINYBIRD_TRACKER_TOKEN=p.eyJ1I...
PROXY_TARGET=https://api.europe-west2.gcp.tinybird.co/v0/events
SALT_STORE_TYPE=memory
…

# Configure Ghost config.production.json

“tinybird”: {
“workspaceId”: “6843f07a-…”,
“adminToken”: “p.eyJ45jo…”,
“tracker”: {
“endpoint”: “http://127.0.0.1:3000/tb/web_analytics”
},
“stats”: {
“endpoint”: “https://api.europe-west2.gcp.tinybird.co”
}
}

I noticed the Tinybird schema includes site_uuid, which seems to suggest we could use a single Tinybird account and a shared TrafficAnalysis proxy for multiple Ghost instances. Since we host multiple Ghost sites in a K3s cluster, I’m wondering:
• Is it possible (or advisable) to run a single proxy for multiple instances?
• Or is it better to deploy a separate TrafficAnalysis proxy per Ghost instance?

Also, I saw Tinybird supports self-hosting. I assume analytics can generate a lot of data in a short time, is there any built-in way to automatically delete old data to keep things manageable? I am not even sure if self-hosting is viable option for production. I might look this up somewhere in doc, but you might know.

Thank you very much and Ghost team for awesome upgrade.

Yes. Both ActivityPub and TrafficAnalytics support multi-tenancy. Source: Doing that exact thing on Magic Pages :smiley:

Not that I have seen. Running Tinybird Local for 700 sites since Monday has created about 700MB so far. That includes both sites that barely have any visitors, and ones that have millions every month.

Tinybird themselves promote it as a development tool. Though, testing both the Cloud version and TB Local, the only difference I see is the missing UI (and the fact that they probably have a highly available setup, but that’s something I am managing myself anyway).

3 Likes

Thank you very much, Jannis for the valuable insights from your hosting realm.
I’ll dig deeper into the local Tinybird setup - your stats seem manageable so far at our much smaller scale.

1 Like