Click the link below to open the Globalflix web app, or if you still have the app open from module 2, click the Globalflix logo on the top right. https://amazon-dynamodb-labs.com/static/global-serverless-application/web/globalflix.html
If you have already successfully loaded the API urls in the last module, you should see a grid of 12 video thumbnails. This has been displayed by performing a query against DynamoDB for the sample data you loaded in module 1.
The API region(s) you set in the previous module should be displayed on the top right, with the current “active” region in solid orange.
For the sake of time in this module we are executing this regional failover within the web application, but in production a more common pattern is to make use of something like Amazon Route 53 Application Recovery Controller to manage the health checks, failover, and recovery of your regional services.
On this page, the selected video will start playing in the middle with the following metrics displayed around it (from left to right):
Underneath the player you can see a log of each write operation performed, note the region being used.
Even though the application stack in that region is now unresponsive, because we are using DynamoDB Global Tables, data updates are still being replicated into that region. When the service recovers, we need not worry about data loss during that outage.
You can verify this if you would like by running a query against the “global-serverless” DynamoDB Table in each of your regions
aws dynamodb query \
--table-name global-serverless \
--region us-west-2 \
--key-condition-expression "PK = :PK" \
--expression-attribute-values '{":PK": {"S": "user10"}}' \
--query 'Items[*].bookmark.S' \
--output text | awk '{print $1": us-west-2"}'
aws dynamodb query \
--table-name global-serverless \
--region eu-west-1 \
--key-condition-expression "PK = :PK" \
--expression-attribute-values '{":PK": {"S": "user10"}}' \
--query 'Items[*].bookmark.S' \
--output text | awk '{print $1": eu-west-1"}'
Your resilient application has now successfully tolerated a failed regional stack, failed to an alternate region, and failed back, all with zero data loss or impact to the users experience.