Plan scalable Recent Gamer Updates feed storage #3

Open
opened 2024-01-14 14:12:23 -06:00 by jimmyb · 6 comments
Owner

The Recent Gamer Updates feed needs a scalable Laravel storage strategy so the site can keep public activity pages fast without blindly deleting historical user activity.

The original issue proposed trimming or truncating the old feed table, but later comments clarified that people do use the feed and that historical records should ideally be preserved. In the current Laravel checkout, feed entries are written to Spatie activity log table with log_name = gamer_updates, displayed through the RecentGamerUpdates presenter, and surfaced on the homepage/sidebar while a dedicated Recent Gamer Updates page is still being rebuilt. This issue tracks deciding and implementing the long-term storage, indexing, archival, and query strategy for that feed.

Scope

  • activity_log records used for gamer_updates.
  • Recent Gamer Updates homepage/sidebar card.
  • Future /recent-gamer-updates listing page and pagination.
  • Any admin/profile/feed surfaces that query activity records.
  • Feed query performance, indexing, archival, retention, and migration/backfill behavior.
  • Preservation of historical feed data unless a future product decision explicitly approves deletion.

Acceptance Criteria

  • Current feed producers and consumers are documented before storage changes are made.
  • Gamer update feed queries use bounded, indexed, newest-first reads and do not require scanning the full activity table.
  • The active/recent feed remains fast when the activity table contains a large historical record count.
  • Historical feed records are preserved by default through an archive/current-table strategy, partitioning strategy, or another documented Laravel-compatible approach.
  • No implementation relies on truncating the table, resetting IDs, or deleting historical data as the primary solution.
  • Any archival or migration process is idempotent, resumable, and safe to run in batches.
  • Existing gamer_updates activity entries continue to render with user, avatar, game, platform, activity type, and timestamp data.
  • Banned, deleted, and soft-deleted users remain excluded from public feed rendering.
  • Admin activity log usage remains separate from public gamer update feed behavior where appropriate.
  • Empty feed states render clearly.
  • User-facing UI supports light/dark mode and follows the existing Laravel/Tailwind site layout patterns.

Test Coverage Required

  • Feature/unit tests confirming Recent Gamer Updates reads are ordered newest-first and limited appropriately.
  • Regression tests confirming existing gamer_updates records render expected card/list data.
  • Tests confirming banned, deleted, and soft-deleted users are excluded from public feed output.
  • Tests covering pagination behavior for the dedicated feed page when that page is implemented.
  • Tests covering any archival/current-feed split, including no missing records, no duplicate records, and stable ordering across boundaries.
  • Command/job tests for archival behavior if a batch archive process is added, including dry-run or idempotency behavior where available.
  • Regression tests confirming admin activity log queries still work after feed storage/index changes.
  • Run the focused affected tests, then run vendor/bin/pint --dirty before closing the issue.

Progress Checklist

  • Spatie activity log table exists
  • gamer_updates activity entries are written from game-list status changes
  • RecentGamerUpdates presenter exists
  • Homepage/sidebar Recent Gamer Updates card exists
  • Sidebar link for /recent-gamer-updates exists
  • Activity log cleanup config exists but currently deletes by age when run
  • Inventory all current and planned gamer update feed producers
  • Inventory all public/admin consumers of activity feed data
  • Choose the long-term current-vs-history storage strategy
  • Add required indexes or migrations for bounded newest-first feed queries
  • Add archival or migration command/job if a split storage strategy is chosen
  • Ensure public feed queries preserve historical data and avoid destructive truncation
  • Build or coordinate with the dedicated /recent-gamer-updates page work
  • Add tests for feed ordering, limits, filtering, archive behavior, and regressions
  • Confirm the final strategy keeps Recent Gamer Updates usable at large table sizes
The Recent Gamer Updates feed needs a scalable Laravel storage strategy so the site can keep public activity pages fast without blindly deleting historical user activity. The original issue proposed trimming or truncating the old feed table, but later comments clarified that people do use the feed and that historical records should ideally be preserved. In the current Laravel checkout, feed entries are written to Spatie activity log table with `log_name = gamer_updates`, displayed through the `RecentGamerUpdates` presenter, and surfaced on the homepage/sidebar while a dedicated Recent Gamer Updates page is still being rebuilt. This issue tracks deciding and implementing the long-term storage, indexing, archival, and query strategy for that feed. ## Scope - `activity_log` records used for `gamer_updates`. - Recent Gamer Updates homepage/sidebar card. - Future `/recent-gamer-updates` listing page and pagination. - Any admin/profile/feed surfaces that query activity records. - Feed query performance, indexing, archival, retention, and migration/backfill behavior. - Preservation of historical feed data unless a future product decision explicitly approves deletion. ## Acceptance Criteria - Current feed producers and consumers are documented before storage changes are made. - Gamer update feed queries use bounded, indexed, newest-first reads and do not require scanning the full activity table. - The active/recent feed remains fast when the activity table contains a large historical record count. - Historical feed records are preserved by default through an archive/current-table strategy, partitioning strategy, or another documented Laravel-compatible approach. - No implementation relies on truncating the table, resetting IDs, or deleting historical data as the primary solution. - Any archival or migration process is idempotent, resumable, and safe to run in batches. - Existing `gamer_updates` activity entries continue to render with user, avatar, game, platform, activity type, and timestamp data. - Banned, deleted, and soft-deleted users remain excluded from public feed rendering. - Admin activity log usage remains separate from public gamer update feed behavior where appropriate. - Empty feed states render clearly. - User-facing UI supports light/dark mode and follows the existing Laravel/Tailwind site layout patterns. ## Test Coverage Required - Feature/unit tests confirming Recent Gamer Updates reads are ordered newest-first and limited appropriately. - Regression tests confirming existing `gamer_updates` records render expected card/list data. - Tests confirming banned, deleted, and soft-deleted users are excluded from public feed output. - Tests covering pagination behavior for the dedicated feed page when that page is implemented. - Tests covering any archival/current-feed split, including no missing records, no duplicate records, and stable ordering across boundaries. - Command/job tests for archival behavior if a batch archive process is added, including dry-run or idempotency behavior where available. - Regression tests confirming admin activity log queries still work after feed storage/index changes. - Run the focused affected tests, then run `vendor/bin/pint --dirty` before closing the issue. ## Progress Checklist - [x] Spatie activity log table exists - [x] `gamer_updates` activity entries are written from game-list status changes - [x] `RecentGamerUpdates` presenter exists - [x] Homepage/sidebar Recent Gamer Updates card exists - [x] Sidebar link for `/recent-gamer-updates` exists - [x] Activity log cleanup config exists but currently deletes by age when run - [ ] Inventory all current and planned gamer update feed producers - [ ] Inventory all public/admin consumers of activity feed data - [ ] Choose the long-term current-vs-history storage strategy - [ ] Add required indexes or migrations for bounded newest-first feed queries - [ ] Add archival or migration command/job if a split storage strategy is chosen - [ ] Ensure public feed queries preserve historical data and avoid destructive truncation - [ ] Build or coordinate with the dedicated `/recent-gamer-updates` page work - [ ] Add tests for feed ordering, limits, filtering, archive behavior, and regressions - [ ] Confirm the final strategy keeps Recent Gamer Updates usable at large table sizes
Author
Owner

Originally posted by josh87

Maybe you can trim it down by date?

**Originally posted by josh87** Maybe you can trim it down by date?
Author
Owner

@josh87 Yeah, I was thinking about how to do it. I was thinking just select 100,000 rows, truncate, then reinsert them. I have to remember which resets the auto-increment back to 1.

@josh87 Yeah, I was thinking about how to do it. I was thinking just select 100,000 rows, truncate, then reinsert them. I have to remember which resets the auto-increment back to 1.
Author
Owner

Originally posted by josh87

Well truncate will drop all records from a table and reset auto_increment.

**Originally posted by josh87** Well `truncate` will drop all records from a table and reset `auto_increment`.
Author
Owner

I am not sure the value it would add to remove this data from the database on a periodic schedule. The only time I have noticed it going slow is when loading the Edit User page from the administrative dashboard side of things. I'd like to think this is a low priority issue at the moment.

I am not sure the value it would add to remove this data from the database on a periodic schedule. The only time I have noticed it going slow is when loading the Edit User page from the administrative dashboard side of things. I'd like to think this is a low priority issue at the moment.
Author
Owner

We need to do some research and see if this page/functionality is really even used by anyone.

We need to do some research and see if this page/functionality is really even used by anyone.
Author
Owner

So people definitely do look at this page (I asked in our Discord server), so we'll need to figure out how to handle the feed. Ideally I don't want to remove any records but at the same time, the table is massive.

So people definitely do look at this page (I asked in our Discord server), so we'll need to figure out how to handle the feed. Ideally I don't want to remove any records but at the same time, the table **is massive**.
Codex changed title from Implement Handling of The Feed (Database Table and Related Pages) to Plan scalable Recent Gamer Updates feed storage 2026-05-25 23:49:06 -05:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MyVideoGameList/myvideogamelist.com#3
No description provided.