# Three tiers apps have four tiers ## Tier 1: Front-end: React Front-end frameworks can support querying GraphQL servers, enabling front-end developers to include the elements they need to compose their datasets. ## Tier 2: GraphQL services: AWS AppSync Graph queries can gather and compose data needed to support a Tier 1 activity. With AWS AppSync we can use AWS Cognito easily for authentication. Identify info is automatically passed to AWS Lambda functions (e.g., `event["identity"]["claims"]["cognito:username"]`). ## Tier 3: Compute: AWS Lambda function Each Lambda function can be highly focused on a small task. It is simpler to reason about a focused function with little distraction. There may be some shared code, for example a data layer. ## Tier 4: DynamoDB By investing time to create a polymorphic table, you can reduce the number of queries needed to support front-end activities. For example, you might have `people` and `activities` in the same table. Efficient table design supports a single query to fetch an item collection instead of performing multiple queries to gather data from separate tables. ### Related - [[GraphQL with Lambda]] - [[GraphQL is a funny solution]] --- Created: 2023-01-20 21:13