3 ms·
> That sounds like a great way to produce a bad UX where a computer with clock drift doesn't successfully write. With real world clock drift, this can be on the
by peterbourgon 7y ago
> That sounds like a great way to produce a bad UX where a computer with clock drift doesn't successfully write. With real world clock drift, this can be on the order of years
That's true, but any reasonable datacenter operation is going to detect clock skew beyond some tolerance (order of seconds) and either correct it, or decomm the nodes until it can be corrected. Pragmatically, data systems like Roshi have to operate within that tolerance, but don't need to accommodate huge differentials. Or, maybe more accurately stated: it's OK if they have weird apparent user behavior in those circumstances, as long as it doesn't throw the whole system into a logically nondeterministic state. Which is the case here.
> If the client timestamps come from your web servers, and they're all on NTP, then it won't be too bad, and the effect will only happen for the maximum NTP offset.
That's right. And it's important to zoom out and look at the actual consequences of missed writes at the application layer. This stuff only comes into play when a specific user makes different actions on a specific key, i.e. if a SoundCloud user likes and then immediately un-likes a track. It could be that the like "beats" the un-like, due to clock skew, and when the user reloads the stream, they still see the track with a heart next to it. "That's annoying," they say, and un-like it again, which almost certainly works. No big deal.
- steventhedev 7y ago> any reasonable datacenter operation is going to detect clock skew beyond some tolerance (order of seconds) It takes time to recognize such failures. If the clock skew is only off by a few seconds or even minutes, the impact isn't so horrible, but if the clock jumps ahead by 20 years, you've effectively prevented any writes to that key for 20 years. Even if you only consider a few days, that's long enough that it can result in lost business. > logically nondeterministic state timestamps should only be used to tiebreak between logically observed events. You've somehow combined a timestamp field as a tiebreaker, as client data to be stored, and as a request id. If you separate them then adjusting the timestamp as a tiebreaker (along with node and counter) will remain logically consistent. > And it's important to zoom out and look at the actual consequences of missed writes at the application layer Lets. You wrote a distributed data store that can lose writes under certain circumstances. If the UX impact is negligible for you, that's great. However, it may be catastrophic for another use (say storing the latest price read for a stock option). For developers to use your database, it means they need to do an impact analysis for every single use. Just wait until someone decides the API is easy enough to use that they try to put payment data in there.
- deleted 7y ago[deleted]
- peterbourgon 7y ago> If the clock skew is only off by a few seconds or even minutes, the impact isn't so horrible, but if the clock jumps ahead by 20 years, you've effectively prevented any writes to that key for 20 years. That's true, but (luckily) it's easy to remediate those objects in the Roshi architecture. > If the UX impact [of lost writes] is negligible for you, that's great. One interesting thing that I've observed about this kind of data system work is that there seems to be a as-of-yet unsolvable tension between "general purpose applicability" and "specific purpose usability". That is, there isn't a way to design a CRDT-based causally-consistent data system which has a general purpose API that consumers can use for a suitably broad set of use cases. Instead, success stories like Roshi seem to require specializing both data semantics and APIs to the specific use cases they target. So, yes, if someone can't tolerate/remediate lost writes due to clock drift, then Roshi is not a suitable system. But, that's fine: data systems don't have to be general purpose to be useful, or to advance the state of the art.
- marknadal 7y agoGeneral purpose CRDTs have been available for at least 5+ years. We have such a system ( http://github.com/amark/gun http://github.com/amark/gun ) that is running in production at the Internet Archive, and P2P versions of Reddit & YouTube that have ~2M users. Dealing with this UX stuff is very important, and we have distributed systems correctness tests (https://github.com/gundb/panic-server https://github.com/gundb/panic-server) that does split brain simulation and recovery, and code to handle timestamp skew even if NTP is running. If you pass this off to developers to be responsible for, they won't know the difference between mistakes in your system and mistakes in theirs. They shouldn't need to be a distributed systems expert to use the database.
- specialist 7y agoI'm really digging this thread. Nicely done. Thanks. As a noob, some kind of Starting Assumptions and Context would be cool for all these distributed infra projects. For instance, I wouldn't have known about mitigating time skews in data centers. Or perhaps even a reference deployment, image(s), playbook, or whatever the devops people are now calling it.