openedx / openedx/openedx-app-ios
Course Info API optimization
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 31
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
Context
As part of the Open edX mobile experience, we are building an API that returns Course Blocks info, Course common info and information about each Course Assignment for the given Course and given User. For a cold request and a large course size, the server response time can exceed several seconds, which is unacceptable for a mobile application and significantly worsens the experience of using Open edX in the mobile version.
However, mobile API require the next operations on backend side::
- Fetching and transforming the course structure (from modulestore and transformers); (>1s)
- Getting common Course info that includes course_progress(get_course_progress function that also calls heave get_assignments_completions function); (>1s)
- Getting progress for each Course Assignment (get_assignments_grades function); (>1s)
I attached to this reply two diagrams with cold request and request with cache for the fairly large course that contains 10 sections and 3-4 subsections in each section. We can see that cold request require about 11 seconds to receive course data, and request with cache requires about 5 seconds for the getting data.
Of course, for a small Course, the query execution time can be much smaller. However, let's try to find ways to speed up the execution of the API query.
Proposed solutions
The proposed solutions are documented in this document
It's updated upon the discussions
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed solutions in the linked Google document and review the three backend operations described: course structure transformation, common course information and assignment progress. Compare the cold and cached request timings in the issue, then define and validate an optimization that reduces the API response time; no files or tests are identified in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- api, backend, mobile-dev, performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100