Design your backend service - Amazon GameLift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Design your backend service

We recommend that you implement a backend service that authenticates your players and communicates with the Amazon GameLift API. By implementing a custom backend service, you can:

  • Customize authentication for your players.

  • Control how GameLift matches and starts game sessions.

  • Use your player database for player attributes such as skill rating for matchmaking instead of trusting the client.

The following diagram shows some possible combinations of Amazon Web Services that you can use to create a backend service. For example, Elastic Load Balancing plus Amazon Elastic Compute Cloud (Amazon EC2), Amazon Elastic Container Service (Amazon ECS), or Amazon Elastic Kubernetes Service (Amazon EKS). Or, Amazon API Gateway plus Amazon Lambda. Or, Amazon AppSync plus Lambda.

            Use different combinations of Amazon Web Services to create a backend

You can also build a serverless backend using API Gateway, Lambda, and Amazon DynamoDB. If you need more control, then you can build container-based backends using an Application Load Balancer and Amazon ECS or Amazon EKS. You can also host your backend application directly with EC2 instances behind an Application Load Balancer. Then, you can use Amazon EC2 Auto Scaling groups to scale the capacity. You can also use Amazon AppSync to build a GraphQL-based backend for your game using WebSockets.

For an example implementation with a serverless backend, see Multiplayer Session-based Game Hosting on Amazon on GitHub. For instructions about using DynamoDB to model player data, see Introduction: Modeling Game Player Data with Amazon DynamoDB.

Authenticating your players

You can use Amazon Cognito to authenticate your game clients. To manage the lifecycle and properties of your player identities, use Amazon Cognito user pools. To integrate your custom identities and external identities, use Amazon Cognito identity pools.

If you prefer, build a custom identity solution and host it on Amazon. You can also use Lambda authorizers for custom authorization logic with API Gateway.

GameLift hosting provides player session IDs, which you can use to make sure that players join the correct game server.

Additional resources: