Class FDBDatabase.WeakReadSemantics

  • Enclosing class:
    FDBDatabase

    public static class FDBDatabase.WeakReadSemantics
    extends Object
    1. Bounds for stale reads; and 2. indication whether FDB's strict causal consistency guarantee isn't required.

    Stale reads never cause inconsistency within the database. If something had changed beforehand but was not seen, the commit will conflict, while it would have succeeded if the read has been current.

    It is still possible to have inconsistency external to the database. For example, if something writes a record and then sends you the id of that record via some means other than in the same database, you might receive it but then access the database from before it committed and miss what they wanted you to see.

    Setting the causal read risky flag leads to a lower latency at the cost of weaker semantics in case of failures. The read version of the transaction will be a committed version, and usually will be the latest committed, but it might be an older version in the event of a fault on network partition.

    • Constructor Detail

      • WeakReadSemantics

        @Deprecated
        public WeakReadSemantics​(long minVersion,
                                 long stalenessBoundMillis)
        Deprecated.
      • WeakReadSemantics

        public WeakReadSemantics​(long minVersion,
                                 long stalenessBoundMillis,
                                 boolean isCausalReadRisky)
    • Method Detail

      • getMinVersion

        public long getMinVersion()
      • getStalenessBoundMillis

        public long getStalenessBoundMillis()
      • isCausalReadRisky

        public boolean isCausalReadRisky()