Introducing concurrency

While this approach works fine in isolation, we'll run into a problem if more than one process needs to concurrently update the starred_by_users column in the same row. Concretely, if two users star a status update at roughly the same time, we'll run into a problem. Consider the following sequence of events:

  1. Both carol and dave want to star alice's status update.
  2. Each of their requests is handled by a separate, concurrent process within the MyStatus application.
  3. The process of the character carol receives the request and begins by reading the current value of the starred_by_users column, retrieving ["bob"].
  4. The process of the character dave receives its request and also reads the current value of starred_by_users ...

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.