forked from hedyorg/hedy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] Make explore page faster (hedyorg#4502)
The `explore` page was (effectively) downloading the entire content of multiple indexes (at least `lang` and `public`, if no other criteria were given), to do a linear filtering operation. The `lang` index is just not discriminatory enough, but the good news is that the `public` index is a lot better. Just use the `public` index, and filter all programs by the criteria that are provided. We've added the feature `FilterExpression`: this allows DynamoDB to do server-side filtering, so we don't have to do it client-side. This is still not arbitrary filtering: we will still get $$$ charged for the data that is read off of disk, the data is just not sent over the network... but that still saves time, and it saves client-side filtering. We've added the `public-date-index` which has just the fields necessary to do this server-side filtering in (`lang`, `adventure_name`, `level`), and no others to save disk space. Gets the load time of the `explore` page down to ~1s. This should also save a chunk of memory on the server. **How to test** Run against the prod database and visit the explore page locally; observe that everything still works.
- Loading branch information
Showing
4 changed files
with
150 additions
and
68 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
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.