vincent pfp
vincent
@pixel
this thing (Warpcast's hub replicator) is really good, kinda curious how the merge happens when the data comes in
1 reply
1 recast
1 reaction

Shane da Silva pfp
Shane da Silva
@sds
We’re using SQL’s “ON CONFLICT” clause specify how to merge data based on some key. If new data arrives that conflicts, it will either be ignored (if for some reason it’s an old message, for example) or we’ll update the existing data.
1 reply
0 recast
0 reaction

vincent pfp
vincent
@pixel
And it's done per batch (the yellow part)? So roughly: 1. pull data, store it in some kind of "pool" 2. every X minutes, merge with DB 3. GOTO 1
1 reply
0 recast
0 reaction

Shane da Silva pfp
Shane da Silva
@sds
That log output is slightly misleading—the yellow line is a low-level log from Postgres, which I can't speak intelligently to. You're seeing the first phase where it queries the hub for all the messages it has for each FID (historical). After, it then reads a live stream of events provided by the hub (ongoing).
0 reply
1 recast
1 reaction