1,000-feet view toward AWS Amplify before you start
it has two components where the confusion generally comes from
Amplify is a wonderful framework, especially for those who just started mobile or webapp development on AWS. But, I would not recommend to use it in the same way how you started using it when you use it in your team-based production system.
Why Amplify is the way to go when you get started?
I started playing Amplify around 3 years ago. I still remember reading the Amplify document (which was not as solid as it is today), and attending a 5-hours hands-on workshop offered by Nader in the AWS office in San Francisco. If you have not watch Nader’s workshop, I highly recommend you doing it — it can get you started and help you grasp how to build a project very quickly. After 5 hours workshop, I was ready to code a complex system.
amplify library makes a lot of AWS programming logic easy. For example, you don’t need to know how the signed URL works to upload and download images when you use amplify framework, which is generally a deep ramp if you don’t use Amplify; another example would be the API-Gateway authorization mechanism using Cognito authorizer; and the list goes on.
So, amplify is definitely something you can choose to start your webapp building journey on AWS.
Why Amplify (CLI part) may not be the best way for you to work in a large project?
I sometimes feel AWS is not very good at naming their project for some reason (another example is Cognito in my opinion, but that deserves another article — I digressed here). AWS Amplify is really about two projects in my mind:
amplify-js, an open source front-end library;
amplify-cli, an CLI that help developers to provision the backend infrastructure (and also help to build the scaffolding code base);
amplify-js is definitely the way to go whether you are a single person hobby project or you have a dedicated front-end team; but for amplify-cli, it comes with alternatives such as serverless (sls), AWS SAM, and more importantly AWS CDK.
Not only these are alternatives to design / define / provision AWS infrastructure for the application, but also they are the tools that backend team and DevOps team are more mentally prepared (see this thread of discussion on Reddit). Here I share my experience where I personally saw and experienced.
First, amplify-cli is great to get your example infrastructure going (especially, when everything is new to you — otherwise, copying with AWS Cognito itself as a beginner will drown you into a deep water); some people say it does not have a robust CI/CD mechanism, but I disagree; as long as you don’t go “out of the box”, you could set up a pretty decent CI/CD pipeline for it;
However, it comes to the level of “control” and “extensibility” when engineers have 2nd thoughts on the amplify-cli. For example, your initial app only needs API-Gateway + Lambda (for app tier) / DynamoDB (for DB tier) / Cognito (for Auth), but later on, you wanted to add other components such as Cloudwatch when running production workload; you wanted to add AWS ElasticSearch for your document search capability. The initial front-end team driven approach starts falling apart.
Next is about DevOps and CI/CD and team structure. Overtime, as long as it is not a single man project (or a super small team that everyone can deal with the whole logic), the team needs to have separate of concerns and different release cadence — after all, we are in an era of micro-services, right? The amplify-cli ‘opinionated’ way made all these mental exercise hard if not impossible.
(Image search result from Google)
Current, I am working on a project that we use amplify-js and we use CDK as our backend infrastructure development / provisioning / CI/CD, and we are pretty happy with it. Maybe it deserves another article to talk about sometimes.
Conclusion:
If you just get started to AWS mobile / webapp development, particularly from the front-end world, you definitely should start using amplify (both amplify-js and amplify-cli);
You still want to use amplify-js as your front-end library to easy your front-end logic coding; but you should talk to your backend team and Infrastructure / DevOps team for the backend solution.
PS: If you like this article, please sign up now so you don’t miss the future issues.
In the meantime, I plan to write one article each week in 2021 to demystify and relate the cloud technology to something we are familiar with — please feel free to tell your friends!