Developing Serverless applications with AWS Amplify

What is Amplify?

Srinivas K
3 min readFeb 4, 2022

AWS Amplify is a set of tools that can be used by front-end developers to build full-stack applications on AWS. This greatly reduces human effort to create a mobile/web backend and visually create a frontend UI abstracting most of the cloud services making it easy for frontend developers with little Cloud experience.

Below diagram from AWS depicts an indicative Serverless web application created by Amplify and how Amplify plays different roles in creating and deploying this application.

Core components of Amplify

  • Amplify CLI : Provides a guided tools to configure a application backend from a desktop
  • Amplify Studio : Provides a visual interface for creating backend resources
  • Amplify Libraries: Amplify provides iOS, JavaScript, Android, Flutter based libraries to integrate user interface with application backends.
  • Amplify Hosting: Host your front-end web app, create/delete backend environments, setup CI/CD on the front end and backend, and access Amplify Studio to configure your backend and manage app content and users.
  • Amplify supports the common SPA frameworks like React, Angular, Vue.js, Ionic, and Ember, as well as static site generators like Gatsby, Eleventy, Hugo, VuePress, and Jekyll.
  • Release Management: Manage production and staging environments for your frontend and backend by connecting new branches.

Supported AWS Backends

Amplify provides seamless integration with below AWS services to accelerate backend development.

  • Authentication: Authentication is powered by Amazon Cognito that makes it easy to develop authentication flows using social providers such as Facebook, Google and Amazon and provides fine grained access control to mobile and web applications.
  • Storage: Integrates with S3 to store user generated content like photos , videos and DynamoDB to store application data. Also provides a on-device persistent storage engine that automatically synchronizes data between mobile/web apps and DynamoDB facilitated by AWS AppSync (GraphQL API).
  • API: Frontends can be integrated with AWS backends using with REST API (Amazon API Gateway) and GraphQL API (AWS AppSync)
  • Functions: Lambda function can be added to Amplify project and can be invoked from frontends using an API.

Amplify also supports Analytics (Powered by Amazon Pinpoint and Amazon Kinesis) to analyze user application usage. Amplify also supports Push notifications, publish-subscribe of messages, predictions, conversational bots and location-aware capabilities.

Considerations for choosing Amplify

AWS Amplify is ideal for small Serverless applications developed using AWS services especially using Amazon Cognito, Amazon DynamoDB, AWS AppSync, Amazon API Gateway and S3. Amplify may not fit if the application is very big and uses any non-AWS service as the backend.

Working with Amplify using Amplify CLI

Below “amplify cli” commands can be used from from a command line utility to create create and deploy applications.

#Installing Amplify CLI 
npm install -g @aws-amplify/cli
#Configure login for Amplify
amplify configure
#Initiate Amplify - from the root of the project directory
amplify init
#Add Amplify components to the application
amplify add
#Add authentication - creates a Cognito user pool
amplify add auth
#Add Lambda function
amplify add function
#Add GraphQL (AppySync) API or APIGateway API
amplify add API
#Add S3 storage (for storing files) or DynamoDB table
amplify add storage
#Create/update AWS resources that are configured
amplify push

References

  1. Amplify Documentation
  2. Amplify Features
  3. Team workflows with Amplify backend environments
  4. Automatic build-time generation of Amplify config
  5. Deploy and host server-side rendered apps with Amplify

--

--

No responses yet