106 points · by aphyr · 7y ago · 23 comments
Doesn't that mean that following use cases are not possible:
1. keeping count of page views
2. vote count per ticket/post
3. like/dislike counts per entity
a reason to use highly scalabale db like Yuga would be to keep such counts.did you mean 'might observe' instead of 'might not'? stale read would result in the older value being read.
i believe the anomaly would then occur depending on how close the 2 events are in time, regardless of frequency.
in that case, precise counts can be needed even with low frequency. say you are a restaurant with 1 burger left. 2 folks order the same time, but you decrement the count by 1 only.
also anything involving monetary values, you definitely don't want to read stale values ever.
Dealing with money is similarly not a problem. ACH takes much longer to clear than the uncertainty window of linearizability violations. The client probably won't be able to tell the difference.
As grogers notes, a stale read is a different phenomenon than the burger problem you describe, which is also called "lost update". We didn't observe any cases of lost updates in YugaByte DB.
As for monetary values, you might find it interesting to ask someone who works in banking or fintech about recency properties of their data systems. Latencies on the order of multiple days are surprisingly common.
* We implemented a feature to share memory between these connection handling processes so that makes it a bit more efficient
* Longer term we are thinking of switching to a thread based model. This is how our other API YCQL works.
(cto / co-founder)
DynamoDB/ElasticSearch's approach of not needing to establish/maintain a connection seems like the ideal solution. I think for applications that would utilize your DB, a minor hit to the speed of an individual request is well worth it as compared to being able to scale up the amount of simultaneous requests.
Peeling the onion one more layer, there are two underlying features that are required:
1) Move to a threaded model to be able to scale instantaneously. This is already the case with YCQL, we're planning on doing this for YSQL.
2) There needs to be a change to the client drivers in order to become smarter to deal with how the app connects to the DB. In fact, we're working on enabling this for the Spring (Java) ecosystem by enhancing the JDSB driver (still in the early stages): https://github.com/YugaByte/ybjdbc
(cto/co-founder)