Study guide
Technical reference and lesson notes
Purpose of This Lesson
AWS Amplify and AWS AppSync address different but complementary parts of application development:
- AWS Amplify provides tools for building, configuring, deploying, and hosting full-stack web and mobile applications.
- AWS AppSync provides a managed GraphQL API layer that can unify data from multiple backend services and support real-time application updates.
Together, they can accelerate development of applications that need authentication, data access, file storage, frontend hosting, and an API layer over distributed services.
Key Concepts
AWS Amplify
AWS Amplify is a collection of tools, libraries, and managed capabilities for developing full-stack web and mobile applications on AWS. It can assist with both frontend development and backend provisioning.
Common Amplify capabilities include:
- Creating application backends for web and mobile clients
- Configuring user authentication
- Defining and connecting application data models
- Adding file storage
- Connecting applications to AWS services through Amplify libraries
- Hosting static websites and server-side rendered applications
- Automating build and deployment workflows through managed CI/CD
Amplify supports common application platforms and frameworks, including web applications using JavaScript, iOS, Android, Flutter, and React Native.
Amplify Studio
Amplify Studio provides a visual interface for creating and managing parts of an application backend and frontend. A development team can use it to define items such as:
- Data models
- Authentication configuration
- File storage
- Application UI components and workflows
The visual workflow is useful when a team wants to move quickly without manually building every backend component. When an application requires AWS services or configuration beyond the available Studio features, the AWS Cloud Development Kit can be used to extend the solution.
Amplify Libraries and CDK Integration
Amplify libraries provide client-side integrations for supported application platforms. They help application code interact with authentication, APIs, storage, and other configured AWS capabilities.
The AWS CDK complements Amplify when infrastructure requirements become more specialized. CDK allows developers to define additional AWS resources and relationships using familiar programming languages, while retaining infrastructure as code and repeatable deployments.
Amplify Hosting
Amplify Hosting is a managed hosting and deployment service for web applications. It supports:
- Static websites
- Server-side rendered applications
- Continuous integration and continuous delivery workflows
- Automated builds from connected source repositories
- Managed deployment of frontend application artifacts
It is a strong fit when the primary requirement is to build and deploy a web frontend with an AWS-integrated workflow. It is not a replacement for every possible compute architecture; applications with specialized runtime, networking, or container requirements may need other AWS services.
AWS AppSync
AWS AppSync is a fully managed service for creating and operating GraphQL APIs. GraphQL allows clients to request the specific fields they need rather than relying only on fixed REST responses.
AppSync can provide a unified API over multiple data sources, including:
- AWS Lambda
- Amazon DynamoDB
- Amazon Aurora
- Amazon OpenSearch Service or compatible search backends, depending on the integration
- Amazon SNS
- HTTP endpoints
This makes AppSync useful when a frontend needs a single API surface over several microservices, databases, or existing HTTP-based systems.
GraphQL Queries, Mutations, and Subscriptions
GraphQL commonly uses three operation types:
- Queries: Read data.
- Mutations: Create, update, or delete data.
- Subscriptions: Receive event-driven updates when relevant data changes.
AppSync allows selected portions of an application’s data to be exposed through subscriptions. This supports use cases such as collaborative applications, live dashboards, messaging interfaces, and real-time status updates.
AppSync Resolvers and Data Sources
A GraphQL schema defines the types and operations that clients can use. Resolvers connect those schema fields to backend data sources. A resolver can retrieve or update data in services such as DynamoDB, invoke Lambda, call an HTTP endpoint, or interact with other supported integrations.
This separation allows the client-facing API model to remain stable even when backend services are distributed or implemented differently.
AppSync Caching
AppSync supports server-side caching for eligible API data. Caching can reduce repeated calls to backend data sources and improve response latency.
Caching requires careful design:
- Identify data that is safe to cache.
- Define appropriate expiration behavior.
- Consider whether users or tenants must receive isolated results.
- Ensure mutations and invalidation behavior do not produce stale or unauthorized responses.
Caching is an optimization, not a substitute for selecting an appropriate persistent data store or designing correct authorization controls.
Architecture Decision Guide
| Requirement | Suitable capability | Why it fits |
|---|---|---|
| Build a web or mobile application backend quickly | AWS Amplify | Provides tools and libraries for common application backend features |
| Visually configure data models, authentication, or storage | Amplify Studio | Reduces the amount of manually implemented backend configuration |
| Add AWS resources not directly supported by Studio | AWS CDK with Amplify | Extends the application architecture using infrastructure as code |
| Host a static frontend with automated builds | Amplify Hosting | Provides managed hosting and CI/CD integration |
| Host a server-side rendered web application | Amplify Hosting | Supports managed deployment patterns for SSR applications |
| Expose several backend services through one API | AWS AppSync | Provides a managed GraphQL aggregation layer |
| Let clients request only required fields | AWS AppSync and GraphQL | GraphQL schemas and queries give clients more precise data selection |
| Deliver selected data changes to connected clients | AppSync subscriptions | Supports real-time updates for subscribed data |
| Reduce repeated reads from backend systems | AppSync server-side caching | Can improve latency and reduce data-source requests |
| Integrate an existing HTTP service | AppSync HTTP data source | Places the service behind a unified GraphQL API |
Exam-Relevant Takeaways
- Amplify is broader than an API service. It supports application development, backend configuration, client libraries, hosting, and deployment workflows.
- Amplify Studio is a visual development interface, not a universal replacement for infrastructure as code. Use CDK when the architecture requires additional or customized AWS resources.
- Amplify Hosting is intended for managed hosting and deployment of web applications, including static and server-side rendered applications.
- AppSync is a managed GraphQL service, not simply a general-purpose web hosting platform.
- AppSync can unify multiple backend sources behind one API, which is useful for applications built from microservices or heterogeneous data stores.
- Subscriptions are the AppSync mechanism for GraphQL-based real-time updates.
- AppSync can integrate with services such as Lambda, DynamoDB, Aurora, search services, SNS, and HTTP endpoints.
- AppSync automatically manages GraphQL API execution capacity, reducing the operational burden of running API infrastructure directly.
- AppSync caching can improve performance and lower backend request volume, but cache authorization, freshness, and invalidation must be designed correctly.
Common Exam Traps
Confusing Amplify with AppSync
Amplify is a broader application development and delivery toolkit. AppSync is a managed GraphQL API service. Amplify applications may use AppSync, but the services solve different problems.
Choosing AppSync for Every API
AppSync is appropriate when GraphQL behavior, data aggregation, or real-time subscriptions are valuable. A simple REST API may be a better fit for a straightforward request-response interface with no need for GraphQL’s flexible queries or subscriptions.
Assuming GraphQL Removes Backend Complexity
AppSync provides the API layer, but backend data modeling, resolver behavior, authorization, throttling, consistency, and error handling still require deliberate design.
Treating Subscriptions as a Global Event Bus
AppSync subscriptions deliver updates to clients that subscribe to the relevant GraphQL data. They should not automatically be treated as a replacement for durable messaging, event streaming, or enterprise integration services.
Ignoring Cache Isolation
If cached responses contain tenant-specific or user-specific data, an unsafe cache key or authorization design can expose one user’s data to another. The cache strategy must account for identity and request context.
Assuming Amplify Studio Covers Every AWS Service
Studio simplifies common workflows, but specialized architectures may require CDK or direct AWS service configuration.
Confusing Hosting with Backend Compute
Amplify Hosting deploys supported web application artifacts and workflows. It does not mean that every backend workload should run in the hosting layer; APIs, workers, databases, and specialized compute remain separate architectural concerns.
Real-World Engineer Notes
- Define the GraphQL schema around client and domain requirements rather than mirroring every underlying database table.
- Use AppSync to hide backend service boundaries when clients benefit from a unified data model. Avoid creating an aggregation layer that merely adds complexity without reducing frontend coupling.
- Keep resolver behavior observable. Distributed GraphQL requests can invoke multiple data sources, so logging, metrics, tracing, and clear error handling matter.
- Be cautious with queries that fan out to many backend systems. A single GraphQL request can still generate substantial backend work.
- Apply least-privilege authorization at both the API and data-source layers. A client being allowed to call a field does not automatically mean it should access every underlying record.
- Use caching for data with predictable freshness and safe sharing characteristics. Do not cache sensitive responses without understanding cache keys and authorization context.
- Treat Amplify-generated resources as production infrastructure. Manage environments, deployments, permissions, and changes through controlled workflows rather than relying only on ad hoc console changes.
- Use CDK or another infrastructure-as-code approach when the application requires repeatable multi-environment deployments or resources outside the standard Amplify workflow.
Quick Reference Summary
- AWS Amplify: Tools and managed capabilities for building full-stack web and mobile applications.
- Amplify Studio: Visual interface for configuring data models, authentication, storage, and application components.
- Amplify Libraries: Client integrations for web and mobile platforms.
- Amplify Hosting: Managed hosting and CI/CD for static and server-side rendered web applications.
- AWS CDK: Infrastructure-as-code extension point for resources and configurations beyond standard Amplify features.
- AWS AppSync: Fully managed GraphQL API service.
- GraphQL query: Reads selected fields.
- GraphQL mutation: Changes data.
- GraphQL subscription: Receives relevant real-time updates.
- AppSync data sources: Can include Lambda, DynamoDB, Aurora, search services, SNS, and HTTP endpoints.
- AppSync caching: Reduces repeated backend access when freshness and authorization requirements permit it.
Flashcards
- Q: What is AWS Amplify designed to help build?
A: Full-stack web and mobile applications, including frontend, backend, authentication, storage, deployment, and hosting workflows.
- Q: What is Amplify Studio?
A: A visual interface for configuring application data models, authentication, storage, and other supported application capabilities.
- Q: How can a team extend Amplify beyond Studio’s built-in capabilities?
A: By using the AWS CDK or direct AWS service configuration as appropriate.
- Q: What is Amplify Hosting used for?
A: Managed hosting and CI/CD for static and server-side rendered web applications.
- Q: What type of API does AWS AppSync provide?
A: A fully managed GraphQL API.
- Q: Why use AppSync in a microservices architecture?
A: It can provide a unified API layer over multiple backend services and data sources, reducing the need for clients to understand each service boundary.
- Q: Which GraphQL operation changes data?
A: A mutation.
- Q: Which GraphQL operation supports real-time updates?
A: A subscription.
- Q: Name three possible AppSync data sources.
A: Examples include DynamoDB, Lambda, Aurora, an HTTP endpoint, SNS, or a search service.
- Q: What is the purpose of AppSync server-side caching?
A: To reduce repeated calls to backend data sources and potentially improve API response performance.
- Q: Is Amplify the same service as AppSync?
A: No. Amplify is a broader application development and hosting toolkit; AppSync is a managed GraphQL API service.
- Q: What is a major cache design concern for AppSync?
A: Ensuring cache keys, authorization, tenant isolation, and data freshness prevent stale or unauthorized responses.
Practice Questions
Question 1
A company is developing a mobile application that requires user authentication, file uploads, a managed backend, and deployment of the client application. The team wants to minimize custom backend integration code and support iOS and Android clients. Which approach best satisfies these requirements?
A. Use Amazon CloudFront and Amazon S3 only
B. Use AWS Amplify and its supported client libraries
C. Use AWS AppSync without any frontend tooling
D. Run a custom API and build all authentication and storage integrations manually
Correct answer: B
Explanation: AWS Amplify provides tools and libraries for web and mobile applications and supports common capabilities such as authentication, storage, backend configuration, and hosting. AppSync could be used as part of the backend, but by itself it does not address the complete application development workflow described.
Question 2
A web application needs one API through which clients can retrieve customer information from DynamoDB, order status from a Lambda-backed service, and product search results from a search service. The frontend should also receive updates when an order changes. Which AWS service is the best fit for the API layer?
A. AWS AppSync
B. Amazon S3
C. AWS CodeDeploy
D. Amazon Route 53
Correct answer: A
Explanation: AppSync provides a managed GraphQL API that can unify multiple data sources and supports GraphQL subscriptions for real-time updates.
Question 3
An application uses AppSync to serve product catalog data. The catalog changes infrequently, but thousands of clients repeatedly request the same product details. The company wants to reduce calls to the backend data store while accepting a short period of staleness. What should the architect consider?
A. AppSync server-side caching with an appropriate expiration policy
B. Replacing GraphQL with Route 53
C. Disabling all resolver authorization
D. Storing all product data in client-side browser storage permanently
Correct answer: A
Explanation: AppSync server-side caching can reduce repeated data-source requests and improve latency. The architect must define suitable freshness, cache-key, and authorization behavior.
Question 4
A development team uses Amplify Studio but must also provision a specialized AWS service and apply custom networking and IAM configuration consistently across development, test, and production. What is the most appropriate approach?
A. Avoid infrastructure as code and configure each environment manually
B. Use AWS CDK to extend the Amplify-managed solution
C. Use AppSync subscriptions to provision the service
D. Store the configuration only in the frontend application
Correct answer: B
Explanation: AWS CDK can extend Amplify-based applications with additional resources and custom configuration while supporting repeatable infrastructure deployments.
Question 5
A company wants a real-time collaboration feature. Only users authorized to a particular project should receive updates for that project. Which design concern is most important when implementing the feature with AppSync subscriptions?
A. Ensuring subscription authorization and filtering prevent unauthorized project updates
B. Using Amplify Hosting as the database
C. Assuming all connected clients should receive every subscription event
D. Disabling authentication because subscriptions are real time
Correct answer: A
Explanation: Real-time delivery must be controlled by authorization and appropriate subscription filtering. Real-time behavior does not remove the need for identity, access control, and tenant or project isolation.