Adding GraphQL API and DynamoDB
Learn how to configure Dynamodb with AWS Amplify CLI.
We'll cover the following
- Introduction
- User table
- Contact table
- Conversation table
- Message table
- Deploying our schema
- Step 1: Run the amplify add api command
- Step 2: Select an API type
- Step 3: Select an authorization type
- Step 4: Enter the number of days
- Step 5: Additional authorization types
- Step 6: Schema template
- Step 7: Editing the schema
- Step 8: Run the amplify status command
- Step 9: Change the directory
- Step 10: Copying the content
- Step 11: Run the amplify update api command
- Step 12: Create an AWS S3 bucket
- Conclusion
Introduction
We have successfully created two AWS resources, and now we need to create an API and a database. For the API, we can use either REST or GraphQL. If we are using REST, AWS Amplify will deploy the API Gateway on our behalf. In our case, we will use GraphQL to deploy and configure AWS AppSyncand later generate all the required mutations, queries, and subscriptions.
The Free Tier offers the following monthly usage levels at no charge for 12 months after you sign up for an AWS account. 250,000 query or data modification operations 250,000 real-time updates 600,000 connection-minutes. Use beyond these levels is billed at the published rates. The AWS AppSync Free Tier automatically expires after 12 months.
For the database, we can either deploy AWS DynamoDB or AWS Aurora. In our case, we will deploy AWS DynamoDB, which can effectively scale and meet any workload demands. We will update and query our database using the mutations and queries generated for us.
25 GB of storage and up to 200 million read/write requests per month with the AWS Free Tier
Now that we have understood the resources we want to deploy, let’s create a schema for our application. Our app will have several responsibilities, and we want to group them as follows.
Get hands-on with 1400+ tech skills courses.