Skip to content

Materialize Student Lesson View #1974

@tomca32

Description

@tomca32

Student lesson view calculates a ton of information and often takes a while. We need to materialize this view and have a way to refresh it a few times a day, say every 6 hours.

Scenic, the gem we're using to create views, has a materialize option, so that part is easy to do. However, we need to figure out the refresh part ourselves. We have two approaches available here:

  1. Leveraging the pg_cron postgres extension: https://github.com/citusdata/pg_cron - this will allow us to refresh materialized view directly in the database, without Rails knowing anything about it.
  2. Use background jobs ActiveJob in Rails. This is probably more complicated as we need to use an additional library for the queue backend such as SolidQueue https://github.com/rails/solid_queue - this is probably a lot more involved than the first approach, so we should only do it if we encounter a problem in the first approach.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions