The MongoDB Engineering Journal

A tech blog for builders, by builders

About the Author

"Jonathan Abrahams"
"Senior Quality Engineer"

Jonathan has worked on large and small projects, from testing Aerospace embedded systems, to a Foreign Exchange Trading system, Networking optical routers, Ad Exchange servers and Mobile media players. Currently he is interested in testing the MongoDB server and automating all that is possible. He enjoys being outdoors, particularly on his bicycles.

Posts by Jonathan Abrahams
  • Testing Linearizability with Jepsen and Evergreen: “Call Me Continuously!”


    What do you do with a third-party tool that proves your application lacks a feature? Add that tool to your continuous integration system (after adding the feature, of course)! In our case we have added linearizable reads to MongoDB 3.4 and use Jepsen to test it.

    Evergeeen logo plus Jepsen

    What is Linearizability?

    Linearizability is a property of distributed systems first introduced by Herlihy & Wing in their July 1990 article “Linearizability: a correctness condition for concurrent objects” (ACM Transactions on Programming Languages and Systems Journal). Peter Bailis probably provides the most accessible explanation of linearizability: “writes should appear to be instantaneous. Imprecisely, once a write completes, all later reads (where “later” is defined by wall-clock start time) should return the value of that write or the value of a later write. Once a read returns a particular value, all later reads should return that value or the value of a later write.”

    In MongoDB 3.4, linearizable reads are now supported on single documents, using a new read concern called “linearizable”. Previously, linearizable reads were possible only by using a findAndModify operation on a single document and updating an extraneous field in the document, with a writeConcern of “majority”. Keep in mind there is a performance penalty for this. Linearizable reads have a performance profile similar to majority writes, as each linearizable read makes use of a no-op majority write to the replica set to ensure the data being read is durable and not stale.

    Read More

Copyright © 2016 MongoDB, Inc.
Mongo, MongoDB, and the MongoDB leaf logo are registered trademarks of MongoDB, Inc.

Powered by Hugo