CloudArcade

Hands-on emulator lab · 6–10 min

Move two records together — DynamoDB and Transactions

Move practice coins between two players using one transaction.

These actions use an isolated AWS Emulator. It stores API state locally; it does not create paid cloud resources or run the full hosted AWS service.

Your goal

Move practice coins between two players using one transaction.

Why this matters

A game trade should update both players together. You will create two balances, move coins with one transaction, and read both resulting balances to check the trade.

Words you will use

A transaction groups changes into one all-or-nothing operation. An item is one record. A balance is a number stored in that record.

How to proceed

Start a fresh emulator, read each numbered step, and enter the practice settings shown. Run the action, inspect its API receipt, then continue. Finish lab checks the emulator state again before saving your progress.

Start this hands-on lab

1. Create two starting balances

Create the table, then give player-a 100 coins and player-b zero. These records are the starting point for a trade that must update both players together.

2. Transfer some coins

Choose how many coins to move. Submit both updated balances in one TransactWriteItems request. If a transaction fails, investigate the error instead of treating one half as a finished trade.

Coins to transfer: Move 1–99 coins from player-a to player-b. Suggested practice value: 25.

3. Read both balances together

Use TransactGetItems to read both players. The lab checks the two expected balances and their shared total. This demonstrates a coordinated update of records in the emulator.

Practice, then check your understanding

Perform the actions yourself and inspect the returned state. Errors keep your settings so you can retry. Starting another lab clears the previous live environment. Earned XP is kept, and signed-in achievements sync to your account. Replay does not award duplicate XP.

Read the official AWS documentation for service behavior and production details.

Continue with another AWS learning guide