Hubble is a mirror for public AT Protocol data. It consumes atproto sync, and produces atproto CARs. It's working, and will be officially released veeerrrry soon. but first, this!
1
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
2
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
40
byteStart
34
features
0
$type
pub.leaflet.richtext.facet#italic
plaintext
Hubble's purpose is to mirror the whole Atmosphere, but another very interesting (smaller!) use-case came up.
Bridgy Fed bridges the Atmosphere and the Fediverse. You can follow friends on Mastodon from your Bluesky account, and seamlessly jump into in conversations that span protocols. It's very cool! So what's a getRepo and what does it have to do with Hubble?
getRepo (legal name com.atproto.sync.getRepo) is one of two core methods to sync from PDSes to the network. The other is the firehose (or com.atproto.sync.subscribeRepos), and they compliment each other:
Atmosphere sync is a careful coordination of these: fetching initial account data (getRepo, "backfill"), tracking changes (firehose), and recovering from errors by resetting (getRepo, "resync").
10
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
15
byteStart
8
features
0
$type
pub.leaflet.richtext.facet#code
plaintext
Without getRepo, there was a Bridgy-shaped hole in the Atmosphere. Bridgy Fed emitted changes on the firehose, but you couldn't backfill initial state or reset after errors for bridged Fediverse accounts.
11
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.header
level
2
facets
0
index
byteEnd
46
byteStart
39
features
0
$type
pub.leaflet.richtext.facet#code
plaintext
It's one endpoint, Micheal. What could getRepo cost?
getRepo produces a complete archive of all public data for one account, structured as a Merkle Search Tree (MST), serialized into a Content-Addressable aRchive (CAR). Collecting all this content-addressed content, from a tree with up to millions of pieces of content, adds up to a…
14
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
275
byteStart
268
features
0
$type
pub.leaflet.richtext.facet#code
1
index
byteEnd
336
byteStart
323
features
0
$type
pub.leaflet.richtext.facet#italic
plaintext
Bridgy Fed stores atproto content in Google Cloud Datastore, which is highly scalable and pretty efficient for producing verifiable data changes for the firehose. But with pay-per-entity-read pricing and an entity-per-piece-of-content-stored design, the cost to serve getRepo can …
15
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
65
byteStart
58
features
0
$type
pub.leaflet.richtext.facet#code
plaintext
With many apps syncing the Atmosphere these days, serving getRepo like this would be unsustainable for Bridgy Fed.
16
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.header
level
2
plaintext
Mirror for a PDS
17
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
49
byteStart
42
features
0
$type
pub.leaflet.richtext.facet#code
1
index
byteEnd
109
byteStart
104
features
0
$type
pub.leaflet.richtext.facet#bold
1
uri
https://atproto.com/guides/glossary#relay
$type
pub.leaflet.richtext.facet#link
2
index
byteEnd
110
byteStart
109
features
0
$type
pub.leaflet.richtext.facet#bold
plaintext
Hubble is an alternate place you can make getRepo requests. It's kind of like how apps subscribe to one relay for the global firehose instead of subscribing to each and every PDS themselves, but the subscription endpoint is the exact same shape for both,
18
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
68
byteStart
61
features
0
$type
pub.leaflet.richtext.facet#code
1
index
byteEnd
165
byteStart
150
features
0
uri
https://atproto.com/specs/xrpc
$type
pub.leaflet.richtext.facet#link
plaintext
a whole-Atmosphere Hubble instance is one place you can call getRepo, with the exact same shape as if you were talking to a PDS. Atmosphere interop! (more about this if you're curious).
This same-shape thing means the reverse works too, of course! You can listen directly to any PDS "firehose" with any firehose tool. Behold, the Eurosky PDS firehose: pdsls.dev/firehose?instance=wss://eurosky.social
20
$type
pub.leaflet.pages.linearDocument#block
block
alt
screenshot of pdsls's firehose page, subscribed to wss://eurosky.social. only the top summary is shown, with uptime (2m57s), total events (965), events/sec (5.0), and top collections (bsky like, post, repost, follow, postgate).
So… what if you ran Hubble, but subscribed it directly to Bridgy Fed, instead of the whole network? We tried it, and
23
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.header
level
3
plaintext
it pretty much just worked?!
24
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
It took about 5 mins over a call with the wonderful Bridgy Fed folks for us to figure out how to set it up:
25
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.unorderedList
children
0
$type
pub.leaflet.blocks.unorderedList#listItem
content
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
41
byteStart
34
features
0
$type
pub.leaflet.richtext.facet#code
plaintext
Bridgy Fed added an auth check to getRepo.
1
$type
pub.leaflet.blocks.unorderedList#listItem
content
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
38
byteStart
31
features
0
$type
pub.leaflet.richtext.facet#code
1
index
byteEnd
54
byteStart
52
features
0
$type
pub.leaflet.richtext.facet#italic
plaintext
The Hubble mirror makes auth'd getRepo requests, so it can backfill from Bridgy Fed and stay in sync.
2
$type
pub.leaflet.blocks.unorderedList#listItem
content
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
42
byteStart
34
features
0
$type
pub.leaflet.richtext.facet#italic
1
index
byteEnd
65
byteStart
58
features
0
$type
pub.leaflet.richtext.facet#code
plaintext
Bridgy Fed serves everyone else a redirect, sending their getRepos over to the mirror!
26
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
27
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
163
byteStart
156
features
0
$type
pub.leaflet.richtext.facet#code
plaintext
We've been live with this in production for a bit over a week now. The Hubble mirror has served terabytes of archives, billions of records, for millions of getRepo requests already.
28
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
29
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
54
byteStart
20
features
0
$type
pub.leaflet.richtext.facet#bold
plaintext
For the Atmosphere, Bridgy Fed can now be synchronized. 65,000 accounts, now truly part of the network!
30
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
43
byteStart
28
features
0
$type
pub.leaflet.richtext.facet#bold
1
index
byteEnd
50
byteStart
43
features
0
$type
pub.leaflet.richtext.facet#code
1
$type
pub.leaflet.richtext.facet#bold
2
index
byteEnd
59
byteStart
50
features
0
$type
pub.leaflet.richtext.facet#bold
plaintext
For Bridgy Fed, it only has one downstream getRepo consumer, at negligible cost after initial backfill.
31
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
44
byteStart
43
features
0
$type
pub.leaflet.richtext.facet#footnote
footnoteId
019fd778-5785-7992-83d3-ecd284e4dfc9
contentPlaintext
OVH VPS-2, actually a bit over-provisioned, it turns out. Data on disk is under 10GB. Bridgy Fed set up a generous monthly donation to cover this + a bit, to keep it going!
1
index
byteEnd
149
byteStart
109
features
0
$type
pub.leaflet.richtext.facet#bold
plaintext
For microcosm it's one little USD$10/mo VPS*, the chance to load-test Hubble under real backfill demand, and a way to help keep the network healthier for everyone 😌
If you have a full-network Tap instance, a lightrail server, or have been playing with the JetstreamV2 pre-release, you are probably already finally synchronized with Bridgy Fed!
34
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
35
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.header
level
3
plaintext
Bridgy Fed stays in control
36
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
110
byteStart
86
features
0
$type
pub.leaflet.richtext.facet#italic
1
index
byteEnd
131
byteStart
130
features
0
$type
pub.leaflet.richtext.facet#footnote
footnoteId
019fd335-2864-7446-a0e4-23dc5bd0b713
contentPlaintext
Hypothetically! just from a threat-modelling perspective! we have a very nice collaborative relationship! and we like each other, i think!
plaintext
So microcosm is serving requests for data that Bridgy Fed holds. What happens if this microcosm ╳ Bridgy Fed collab falls apart?*
37
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
The microcosm threat is actually pretty limited:
38
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.orderedList
children
0
$type
pub.leaflet.blocks.orderedList#listItem
content
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
23
byteStart
17
features
0
$type
pub.leaflet.richtext.facet#bold
1
index
byteEnd
55
byteStart
42
features
0
$type
pub.leaflet.richtext.facet#italic
plaintext
The archives are signed (that's the A for Authenticated in AT Protocol). Whatever Hubble serves is verifiable. Hubble can't tamper undetected.
Bridgy Fed serves a 302 Found redirect to the mirror, a non-permanent redirect. Bridgy Fed is always in the loop for every getRepo request, and can turn it off instantly.
startIndex
1
39
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
And of course, they could switch to self-hosting the mirror. Like all microcosm projects, Hubble is open-source:
I'll write more about how Hubble works soon. But it's basically cheaper because it doesn't have to be a full PDS implementation. It gets away with no content-addressing internally, no stored Merkle Search Tree at all, and no pay-per-read cloud storage.
46
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
plaintext
47
$type
pub.leaflet.pages.linearDocument#block
block
$type
pub.leaflet.blocks.text
facets
0
index
byteEnd
7
byteStart
0
features
0
$type
pub.leaflet.richtext.facet#bold
1
index
byteEnd
39
byteStart
28
features
0
$type
pub.leaflet.richtext.facet#italic
2
index
byteEnd
59
byteStart
40
features
0
$type
pub.leaflet.richtext.facet#italic
3
index
byteEnd
69
byteStart
60
features
0
$type
pub.leaflet.richtext.facet#italic
4
index
byteEnd
181
byteStart
153
features
0
$type
pub.leaflet.richtext.facet#italic
plaintext
Next up for microcosm is to officially, publicly, properly, for real announce the whole-network Hubble mirror launch. I'm busy wrapping up details, it's really almost finally there!
Microcosm runs on community support! If you liked this article, if you like community infra, or if you like when the whole Atmosphere can be synchronized:
Bridgy Fed ran up ~$500 in storage reads over one day of opening getRepo to the network, which they extrapolated to ~$15k/mo to keep it open, so $10/mo is 1,500x cheaper than that estimate.
But that over-states it, because once clients can sync, they stop retrying (especially af…