Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Include a suggested plan

...

  • 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 inconsistent or out of date information for making decisions

Suggested Plan

  • Continue with work to improve the slowest response time HTTP requests in the analysis:
    • Fetching automated patron blocks (the Vega team have already done some work to improve this)
    • Fetching manual patron blocks (Holly is raising an issue for this soon)
    • Fetching an item by barcode (the Core Platform team have already done work to improve this)
    • Updating an item (Julian has raised an issue for this)
  • Work with the RA SIG and POs to decide whether some tolerance for potentially inconsistent / out of date information may be used during check out
  • Work with Technical Council and Tech Leads on designs for the use potentially inconsistent data e.g. caching or persistent derived data
  • Begin to introduce derived data during check out
    • Starting with introducing an expiry cache for a single record type that is populated during a check out, as this approach likely has a shorter lead time to benefits at the trade off of less consistent performance
    • Iterating through remaining record types in a priority based upon feedback from the RA SIG and the relative response times for requests (likely isn't appropriate for large data sets like instances or items)
    • Investigate adopting Kafka for updating the cache (as this could lead to reduced delay to become consistent)
    • Investigate adopting persistent derived data rather than caching (as this removes the need for per-module instance caching, can spread rather than duplicate the effort of achieving consistency, and allow for more use of derived and more efficient structures)

Appendices

Definitions

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 Derived data can be outdated with respect to the it source(s). 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 architectures.

Requests made during a typical check out

...

IntentEndpointDestination Module

Sample Response Time (ms)

Sample Response Time of Token Check (ms)
Initial request


99
Fetch user (making the request)GET /users/{id}mod-users6
Fetch permissionsGET /perms/users?query=userId=={id}mod-permissions16
Generate downstream token

12
Fetch user (patron) by barcodeGET /users?query=barcode=={userBarcode}mod-users1386
Fetch manual blocksGET /manualblocks?query=userId=={userId}mod-feesfines1337
Fetch automated blocksGET /automated-patron-blocks/{userId}mod-patron-blocks546*27
Fetch item by barcodeGET /item-storage/items?query=barcode=={itemBarcode}mod-inventory-storage163**10
Fetch holdingsGET /holdings-storage/holdings/{id}mod-inventory-storage579
Fetch instanceGET /instance-storage/instances/{id}mod-inventory-storage227
Fetch locationGET /locations/{id}mod-inventory-storage913
Fetch libraryGET /location/units/libraries/{id}mod-inventory-storage107
Fetch campusGET /location/units/campuses/{id}mod-inventory-storage107
Fetch institutionGET /location/units/institutions/{id}mod-inventory-storage117
Fetch service pointGET /service-points/{id}mod-inventory-storage98
Fetch material typeGET /material-types/{id}mod-inventory-storage87
Fetch loan typeGET /loan-types/{id}mod-inventory-storage228
Fetch existing loansGET /loan-storage/loans?query=status.name=="Open" and itemId=={itemId}mod-circulation-storage917
Fetch requestsGET /request-storage/requests?query=itemId=={itemId} and status==("Open - Not yet filled" or "Open - Awaiting pickup" or "Open - In transit" or "Open - Awaiting delivery") sortBy position/sort.ascendingmod-circulation-storage109
Fetch circulation rulesGET /circulation/rulesmod-circulation-storage1818
Fetch loan policyGET /loan-policy-storage/loan-policies/{id}mod-circulation-storage108
Fetch tenant localeGET /configurations/entries?query=module=="ORG" and configName=="localeSettings"mod-configuration1610
Fetch overdue fines policiesGET /overdue-fines-policies/{id}mod-feesfines198
Fetch lost item fees policiesGET /lost-item-fees-policies/{id}mod-feesfines1110
Fetch opening daysGET /calendar/periods/7068e104-aa14-4f30-a8bf-71f71cc15e07/calculateopening?requestedDate={{dueDate}}mod-calendar128
Fetch user (patron) groupsGET /groups?query=id=={groupId}mod-users177
Update item statusPUT /item-storage/items/{id}mod-inventory-storage19413
Create loanPOST /loan-storage/loanmod-circulation-storage168
Update (question) patron action sessionPOST /patron-action-session-storage/patron-action-sessionsmod-circulation-storage107
Fetch userGET /users/{id}mod-users615
Fetch patron notice policy

GET /patron-notice-policy-storage/patron-notice-policies/1a821238-0cd9-48d9-a71a-057d33df0154

mod-circulation-storage67

* The Vega team have already done some work to improve this

...



References

[1] Martin Kleppman: Designing Data-Intensive Applications. O'Reilly, 2017. ISBN: 978-1-449-37332-0 

...