Skip to content

VAR reversals: Add global secondary index to live activities payload table#1856

Open
vlbee wants to merge 1 commit into
mainfrom
live/var1-gsi-setup
Open

VAR reversals: Add global secondary index to live activities payload table#1856
vlbee wants to merge 1 commit into
mainfrom
live/var1-gsi-setup

Conversation

@vlbee

@vlbee vlbee commented Jul 16, 2026

Copy link
Copy Markdown
Member

Followed by #1857

What does this change?

Adds a Global Secondary Index to the live activities payload table

  • primary key match id
  • sort key by ttl (we can use ttl as a proxy for created date to find the most recent payload sent for a given match id.)

ttl = (System.currentTimeMillis() / 1000) + (14 * 24 * 3600)

This PR needs to be deployed in isolation for the creation of the GSI.

The live activities Payload table is billed on demand, so AWS will handle capacity when the GSI first rolled out. Subsequent writes to the main table will also update the GSI simultaneously.

I don't think it is strictly neccessary to check the notifications payload table and diff in two places - if we decided we need a GSI on the push notifications table, this is provisioned so either A/ needs to be converted to on demand or B/ provisioned capacity reviewed as writing to GSI consumes write units. The initial creation of the GSI may also require a temp increase in provisioned capacity.

Both tables a relatively small so it should be safe to use Projection.ALL on the GSI

*mobile-notifications-liveactivities-PROD - 79 items - Table size 28.4 kilobytes
*mobile-notifications-football-notifications-PROD - 784 items - Table size 1 megabyte

Why?

Introduction of VAR in football matches means key events such as a goal or red card can be reversed. This is not captured in the incoming PA data; the overruled event simply disappears from the match event timeline. In practice this means LiveActivities and updated Android push notifications display the wrong score until a subsequent "triggering event" emits a new update.

We plan to diff the incoming football data and insert a state-change synthetic event to trigger an update to capture these otherwise invisible changes.

image

How has this change been tested?

Deployed to CODE, new index built as expected.
Index is queriable via the AWS console.

How can we measure success?

Have we considered potential risks?

Images

Accessibility

* primary key match id and sort key by ttl to allow us to easily find the most recent payload sent for a given match id.
@vlbee vlbee changed the title Add global secondary index to live activities payload table VAR reversals: Add global secondary index to live activities payload table Jul 16, 2026
@vlbee
vlbee marked this pull request as ready for review July 21, 2026 09:45
@vlbee
vlbee requested a review from a team as a code owner July 21, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant