-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use course cache to retrieve course data
- Loading branch information
Showing
11 changed files
with
117 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
4. Use of the LMS course caches | ||
############################### | ||
|
||
Status | ||
****** | ||
|
||
**Accepted** *2024-02-26* | ||
|
||
Context | ||
******* | ||
Each course run ID in edx-platform is associated with another course ID. While for many courses, the mapping between | ||
course run ID and course ID is straight forward, i.e. edX+testX+2019 -> edX+testX, this is not the case for every | ||
course on edX. The discovery service is the source of truth for mappings between course run ID and course IDs, and | ||
string manipulation cannot be relied on as an accurate way to map between the two forms of ID. | ||
|
||
The learning-assistant CourseChatView NEED LINK accepts a course run ID as a query parameter, but parts of the python API defined | ||
in the learning assistant backend also require the course ID associated with a given course. | ||
|
||
Decision | ||
******** | ||
In order to determine the mapping between a course run ID and course ID in the learning-assistant app, we will make | ||
use of an existing cache that is defined in edx-platform (https://github.com/openedx/edx-platform/blob/c61df904c1d2a5f523f1da44460c21e17ec087ee/openedx/core/djangoapps/catalog/utils.py#L801). | ||
This is a long term cache with a TTL of 24 hours, and on a cache miss this code will call the discovery API directly. | ||
|
||
Consequences | ||
************ | ||
* If the cache were to be removed, code in the learning-assistant repository would no longer function as expected. | ||
* On a cache miss, the learning-assistant backend will incur additional performance cost on calls to the discovery API. | ||
|
||
Rejected Alternatives | ||
********************* | ||
* Calling the discovery API directly from the learning-assistant backend | ||
* This would require building a custom solution in the learning-assistant app to call the discovery service directly. | ||
* Without a cache, this would impact performance on every call to the learning-assistant backend. | ||
* Using string manipulation to map course run ID to course ID. | ||
* If we do not use the discovery service as our source of truth for course run ID to course ID mappings, | ||
we run the risk of being unable to support courses that do not fit the usual pattern mapping. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.