Overview
Google Cloud Spanner is a fully managed horizontally scalable, globally distributed, relational database service that provides ACID transactions and SQL semantics without giving up performance and high availability. These features makes Spanner a great fit in the architecture of games that want to enable a global player base or are concerned about data consistency.
In this lab, you will create four Go services that interact with a regional Spanner database. The first two services, profile-service and matchmaking-service, enable players to sign up and start playing. The second pair of services, item-service and tradepost-service, enable players to acquire items and money, and then list items on the trading post for other players to purchase.
You will then generate data leveraging the Python load framework Locust.io to simulate players signing up and playing games to obtain games_played and games_won statistics. Players will also acquire money and items through the course of "game play". Players can then list items for sale on a tradepost, where other players with enough money can purchase those items.
You'll also query Spanner to determine how many players are playing, statistics about players' games won versus games played, players' account balances and number of items, and statistics about trade orders that are open or have been filled.
Objectives
In this lab, you will:
- Set up a Cloud Spanner instance
- Create a game database and schema
- Deploy Go apps to work with Cloud Spanner
- Use read-write transactions to ensure consistency for data changes
- Leverage DML and Spanner mutations to modify data
- Generate data using Locust
- Query data in Cloud Spanner to answer questions about games and players
#gcp #googlecloud #qwiklabs #learntoearn
Ещё видео!