Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Use eventual consistency instead of potentially stale

...

...

Use derived data to make decisions

This option has the most potential design variations. It might involve in-memory caching or persistent storage of the copied data and it may involve using messaging infrastructure or periodic requests.Irrespective of the design variations, in involves using data that would be considered eventually consistent, meaning that at the time of use it might be out of date with respect to the source of that data (and at some point after it will become consistent again).

In order for this option to be acceptable, a variety of stakeholders within the community would need to accept some tolerance for decisions being made with stale inconsistent information. When I've talked with folks about this previously, they have been uncomfortable with doing this (see above).

This option also has the most potential design variations. It might involve in-memory caching or persistent storage of the copied data and it may involve using messaging infrastructure or periodic requests.

Characteristics

  • Increases the potential for stale data inconsistent data (that is out of date) to be used for decisions
  • State changes still require a downstream request (and the requisite proxying overhead)
  • Is contrary to constraints that may still be present in FOLIO
  • Requires less / no (depending upon variations chosen) downstream requests for fetching data during check out process
  • Introduces complexity of either caching or processing messages and persistent storage into mod-circulation
  • May introduces a dependency for mod-circulation on a database 
  • May introduces a dependency for mod-circulation on messages produced by other modules
  • May introduce the need for a system user for mod-circulation (to populate / update the cache)

...


Periodic HTTP requestsMessages consumed from Kafka
Freshness

Dependent upon frequency of periodic refresh.

Likely to be lead to data being stale for inconsistent for longer than with messaging

Dependent upon message processing latency
Access requirementsNeeds a system user or module permissions granting to a timer endpointNeeds access to Kafka topics for every record type (assuming record snapshot based messages as used with mod-search)
Initial population / manual state refreshRequires requests to fetch all records for for all cached records typesEither requires reprocessing of persistent topic (not currently allowed by FOLIO standards) or custom process (similar to mod-search re-index process)
Load on other modules during synchronisationCould be significant. Dependent upon number of record types and quantity of recordsPotentially none with persistent topics (not currently allowed by FOLIO standards)

...

  • adoption of techniques (e.g. synchronising copied data, messaging, caching) and technologies (e.g. Kafka) unfamiliar to most developers in FOLIO 
  • agreement from many stakeholders (e.g. SME's, TC) that it is acceptable to use potentially stale data for inconsistent or out of date information for making decisions

Appendices

...

PhraseDefinition
Downstream requestA request made by a module (via Okapi) in order to fulfil the original incoming request e.g. mod-circulation makes a request to mod-users to fetch patron information
Response timeThe time taken from the client making the request to receiving a response
Derived data"A dataset that is created from some other data through a repeatable process. Usually use to speed up a particular kind of read access to the data. Indexes, caches, and materialized views are examples of derived data" ([1], pg. 554)
Eventual consistency

Copies or derivations of data can be outdated with respect to the source. It is intended that this inconsistency is temporary, however this deliberately vague and there is no limit on on how far behind ([1] pg. 162) a copy might get or how long it will take for it to become consistent again.

The term originates from database replication and is often used in event sourcing or event driven architecture .

Requests made during a typical check out

...