Skip to content

Course Info API optimization #631

@stan-neichev

Description

@stan-neichev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions