|
| 1 | +# 1. Springshare Source Naming |
| 2 | + |
| 3 | +Date: 2023-07-26 |
| 4 | + |
| 5 | +## Status |
| 6 | + |
| 7 | +Proposed |
| 8 | + |
| 9 | +## Context |
| 10 | + |
| 11 | +While working on adding two new sources to TIMDEX pipeline, there was some discussion and constraints around what source names should be used. |
| 12 | + |
| 13 | +Both data sources are both from Springshare, Libguides and the AZ list of databases, and are retrieved via OAI-PMH. |
| 14 | + |
| 15 | +At this time, source names are a string that accompany the records throughout the TIMDEX pipeline: |
| 16 | + * `transmogrifier`: defined in `transmogrifier.config.SOURCES` |
| 17 | + * drives what transformer class to use |
| 18 | + * saved to TIMDEX record as field |
| 19 | + * used for S3 key (folder structure + filename) |
| 20 | + * `timdex-pipeline-lambdas`: defined in `lambdas.config.INDEX_ALIASES` |
| 21 | + * promotes a newly created index to specific aliases if configured |
| 22 | + * used for S3 key (folder structure + filename) |
| 23 | + * `timdex-index-manager`: defined in `tim.config.VALID_SOURCES` |
| 24 | + * prevents indexing of sources if not present in this list |
| 25 | + * used for index name created in OpenSearch |
| 26 | + |
| 27 | +Two distinct areas of consideration emerged when deciding on a source name: |
| 28 | + * **meaningful** |
| 29 | + * does it suggest what the original data source is? |
| 30 | + * does it have value or meaning to end users of the API? |
| 31 | + * **technically viable** |
| 32 | + * does it have special characters? are they allowed? |
| 33 | + * does it result in predictable S3 key naming conventions throughout? |
| 34 | + * is it an allowed OpenSearch index name? |
| 35 | + |
| 36 | +## Decision |
| 37 | + |
| 38 | +The following source names were decided on: |
| 39 | + * `libguides`: the Libguides data source |
| 40 | + * oai set: `guides` |
| 41 | + * `researchdatabases`: the AZ list databases |
| 42 | + * oai set: `az` |
| 43 | + |
| 44 | +### `libguides` |
| 45 | + |
| 46 | +Pretty self-explanatory, satisfies both "meaningful" and "technically viable" requirements. |
| 47 | + |
| 48 | +### `researchdatabases` |
| 49 | + |
| 50 | +This one was a bit thornier. |
| 51 | + |
| 52 | +It was suggested that `az` was not terribly helpful for understanding where the data came from, and was very unhelpful for end users. |
| 53 | + |
| 54 | +The first agreed upon alternative was `research_databases`. `databases` was also floated, but could be ambiguous from the POV of an end user. |
| 55 | + |
| 56 | +For a variety of reasons, attempting to keep these words distinct in the name failed: `research_databases`, `research-databases`, and `researchDatabases`. The reasons are outlined in [this Jira ticket comments](https://mitlibraries.atlassian.net/browse/TIMX-19?focusedCommentId=107019): |
| 57 | + * `research_databases`: index name not correctly parsed in `timdex-index-manager` |
| 58 | + * `research-databases`: files not saved correctly to S3 in `timdex-pipeline-lambdas` |
| 59 | + * `researchDatabases`: not a valid Opensearch index name |
| 60 | + |
| 61 | +And so, the final decided upon source name was `researchdatabases`; no hyphens, underscores, or camelCasing. |
| 62 | + |
| 63 | +## Consequences |
| 64 | + |
| 65 | +The source name `researchdatabases` reflects some compromises that must be made for sources: |
| 66 | + * if the source name is meaningful to end users, it may lose fidelity about the source origin |
| 67 | + * if the source name is technically viable, it may lose some human readability |
| 68 | + |
0 commit comments