openedx / openedx/openedx-app-ios

Course Info API optimization

Open
#631 0 comments 0 reactions 0 assignees View on GitHub

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.

Image Image
Proposed solutions

The proposed solutions are documented in this document

It's updated upon the discussions

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.