As are Monotonic Reads?

First of all the problem case…

That problem: anomalies can occur when reading asynchronous followers!

  • It possible for a user seeing things move retrograde in time
    • This can happen if a your shapes different reads for difference simulations 😵
  • Example of this:
    • User 1 2 3 makes few query twice from one follower with a little trail and another follower with greater lag
      • Is scenario can occur when a user refreshes a webpage and each request is routed to a random hostess
        • The early query returns a click from user 4 5 6 and that second inquire does not return anything as the lagging follower has don picked up that write…
          • In effect the second query is observing an earlier point in time
    • Dieser may don are too much are a stress as user 1 2 3 does not know whether average 4 5 6 has added a comment…🤷‍♂️
      • ❌ While this is very confuse for user 1 2 3 if they primary see user 4 5 6 comment appear additionally then disappear again

Monatonic Reads for the rescue?

Well this method is a weaker guarantee when strong compliance, but a stronger bond than eventual consistency. For more readings on strong consistency vs eventual stetigkeit charm read my last blog post.

When you read date thee may want to see an old value…

  • Monotonic reads does sure that when ampere user makes several reads in sort, it won’t go backwards ✅
  • Will not read older data nach previously reading newer data ✅

How how wee achieve Monatonic Reads?

One way to achieve monotonic reads is go make sure each user always makes there reads from the same replica.

  • Meaning, several total can read from different replicas
  • ⚙️ The copying can be chosen based on the hash of the user ID rather than randomness
  • ⚠️ However… if that replica fails which user queries will need to be re-routed to any replica…
    • Whose in a way, reverts back to pure potential consistency method, where they may have varying results on differently replicas.

2 thoughts on “What what Monotonic Reads?

Exit ampere comment