People often ask me if they should use the Serverless Framework or AWS Amplify for a project they are working on.
In this article, I’ll give a quick overview of both systems, the pros, and cons of both Amplify and the Serverless Framework, as well as when I would use each one.
Quick Overview
AWS Amplify
AWS has built Amplify as a tool to make it easy to build, host, and deploy your apps inside AWS. It makes it easy to set up APIs, DynamoDB tables, and Cognito authentication. Its main goal is to make it as easy as possible for anyone to build an application in AWS.
The Serverless Framework
The Serverless Framework is an open-source project that makes it easier to create APIs with AWS by compiling down to cloud formation and giving a clear way to define API endpoints, lambdas, and integration into multiple services from those lambdas. It also has a huge community and hundreds and hundreds of plugins that make it easy to add more functionality.
In-Depth Review
What are the benefits of Amplify?
- You can build most things using the web UI ( No code editor needed )
- It’s super easy to view and download existing projects
- It has built-in CI/CD
- Amplify Studio allows you to manage your data in your app really easily
First of all, it’s meant to make it as easy as possible to build applications with DynamoDB and Cognito.
One great thing about Amplify is that you can design, build and view your applications directly in your browser. No need to install a code editor!
If we open an existing project, we can see that we can have authentication, APIs and file storage on the back end. It’s also super simple to download an existing project to make changes if we prefer to do that in code.
Third, Amplify has CI and CD built in. So, if you click on ‘hosting environments’, you can connect your GitHub or bitbucket repo so that whenever there is a change, it is automatically deployed into your environment. This is great because CI and CD are usually hard to set up and take a lot of time and experience to set up.
Amplify Studio
Another cool thing is the Amplify Studio; if you click on ‘launch studio,’ you get this really nice UI which is basically a management APP for the Amplify environment.
There are things you can do with it; for example, if you click on the ‘manage>> content,’ it will find all of your dynamo tables and let you add, remove, or change items in your database right from within the UI.
Also, when browsing files, we can see all of our S3 information and change any files that need to be changed.
Lastly, when it comes to management, we can go to ‘user management’ and see all of the users who have signed up for this application. We can delete users or change their information as needed.
When we talk about Cognito, we can control how it works, how people sign up, and how they log in by going to the setup and ‘authentication page.’
When we click on ‘data,’ we can do something similar with our Dynamo databases, where we can define our data model.
We have the drop-downs so we can define everything from within the console. This is a nice way to do things because you can design your whole database schema in the console instead of doing it in code.
There’s a similar thing for S3 ‘storage’ where we can control what a signed-in user or a guest user can do.Â
If we move on to ‘functions’ where there isn’t a UI for this, there are some very simple commands that tell you how to do it in your APIs local environment.
There’s also configuration for GraphQL, REST, and more advanced services like analytics, predictions, interactions, and notifications. These services use a lot of different AWS services in the background, from translating to transcribing poly and a lot more, so they’re a great way to use serverless services without having to dig into the code for each one.
Amplify UI Library
The UI library is one of the new features that come with amplify studio. You can design your application in Figma and then have it automatically turn that design into React components. These can then be used in your application, even if you don’t have much experience with React components. You can design it all in Figma, export it, and then use it to make your app. This means writing far less of custom React code.
Amplify also has a new feature that lets you add to them with the AWS CDK. This means that if there is something you can’t set up through the Amplify system, you can just define it in the CDK, and it will be deployed as part of your application. It also has a very active development from AWS. On the plus side, there are always new features and improvements to make the experience and functionality even better.
Drawbacks of Amplify
Amplify has a few drawbacks.
- Poor local testing support
- Small community and has fewer tutorials
- You don’t have fine control over your app
- The UI changes relatively often
One is that local testing is not very well supported. Your GraphQL endpoints can be mocked, but REST APIs are not as well supported.
The second problem is that the community is small and new since Amplify is a fairly new product. This means there are fewer tutorials and fewer people who can help you if you get stuck. There are also only about four or five community plugins.
AWS use sensible defaults for how things work under the hood. That’s great if you don’t have much experience, but if your app grows and you need to change how something works, there often isn’t a way to change it.
Lastly, Amplify is a relatively new product. AWS want it to succeed so are pushing lots of new features and updates. Sometimes this means the way you do something changes which can be annoying.
What are the Benefits of the Serverless Framework?
- Super easy to set up APIs
- Huge community
- Lots of plugins
- Serverless Dashboard enables CICD and monitoring
There are a lot of things going on with the Serverless Framework right now. It is very easy to set up APIs and Lambda functions, which was the original goal of the project.
It also has a huge community, which means there are tutorials for almost anything you can think of and large communities on forums, so if you have a question, there is almost certainly someone who can help you.
Whether you want to set up Cognito using app sync or something else, there are plenty of plugins available to help streamline your development process so that you don’t have to write as much raw cloud formation code.
Another good thing about it is the serverless dashboard. This is a service from a serverless company, and it lets you add things like CI, CD, and monitoring in an easy-to-use way, similar to how Amplify works.
Drawbacks of Serverless Framework
- You might have to write some CloudFormation
- Not designed for people who don’t know how to code
Unfortunately, as with everything else, the Serverless Framework does have a downside. It was originally designed for API development. If you like to do something else, like work with DynamoDB tables, S3 buckets, or Cognito, you’ll need a plugin or to write raw CloudFormation. There is often a plugin for what you want to do, but if not then you’ll have to write some raw CloudFormation.
The Serverless Framework is also not as low code or easy for new developers to use as something like Amplify. There isn’t a really pretty console that lets you set things up from a UI. It is based more on code, but I think that has to do with who they expect to be using it.
Is AWS Amplify better than Serverless Frameworks?
If you’re brand new to AWS or started learning software development and want to build a website, I’d recommend Amplify. It will make your first steps into AWS and deploying a simple application easier.
On the other hand, if you’re building a SaaS app, you’ll almost certainly need features that go beyond what Amplify can do so you should choose the Serverless Framework.
The third case is when you are making a proof of concept or demo and need something to be up and running as soon as possible. I would go with Amplify in this case unless you need a very specific back-end feature for your proof of concept or demo to work. At this proof-of-concept stage, it will be important how quickly you can get set up and get your app running. You can move it to a more scalable tool if the proof-of-concept goes well.
If you want to become a full-time developer I recommend the Serverless Framework. If you want to learn how then check out my guide here!
Most companies won’t use Amplify because it’s made with limitations and restrictions. This limits what they can do with experienced developers. With the Serverless Framework, you have full control over how everything in your application is set up.