Follow

software architecture question, distributed clocks 

say that i have a p2p chat application

whose clock do i trust to order messages?

· · Web · 3 · 4 · 2

software architecture question, distributed clocks 

i know that this is a Very Hard Problem and i am prepared for Complex Solutions

software architecture question, distributed clocks 

@garbados someone else's? NTP?

software architecture question, distributed clocks 

@garbados none, have each message reference an earlier message for ordering, and use a deterministic tie-breaking if you have multiple messages with the same parent

software architecture question, distributed clocks 

@chj0 so one might use a scheme like, each message links to its predecessor, but also has a created_at field that is used for tie-breakers... perhaps?

i think it’s that combination approach that i hadn’t considered. thanks!

software architecture question, distributed clocks 

software architecture question, distributed clocks 

@garbados
Mostly that, but use received at rather than sent at for sorting. You never know what junk you'll get for a sender timestamp
@chj0

software architecture question, distributed clocks 

@yaaps @chj0 received by who? in a p2p messaging system peers might catch me up on messages sent to a chatroom while i was logged out, so do i use the timestamp for when i received it (very very late) or when my peers received it (indeterminate, various)?

software architecture question, distributed clocks 

@garbados
Oh... Gossip protocol. Yeah. You're stuck with sent at. I was picturing a live connection

Sign in to participate in the conversation
Friend Camp

Hometown is adapted from Mastodon, a decentralized social network with no ads, no corporate surveillance, and ethical design.