AWS Amplify has a few principles. It's not meant to be a restrictive set of rules or even guidelines. It's more of a philosophy about how things should be done in principle. Ultimately, the idea is along the lines of the don't reinvent the wheel rule and the easy solution is probably the right one. It promotes speed and ease.
- I want to talk for just a minute about some of the Amplify principles. We can find those at the GitHub page for Amplify itself. So we're going to go to github.com/aws-amplify and here you have a typical GitHub page. We're going to go to the amplify-js page and then into Wiki. And we'll see that there's some principles that Amplify works on. First and foremost, Amplify exposes to you what things do and then how best to do them.
I like these principles and it's a good way to get an understanding of what Amplify does and a little bit about how it does it. Not necessarily implementation-wise, but the philosophies and concepts. The first one is opinionated implementations. This is basically the way that it sets things up for you using a lot of defaults. So some service interactions are favored over others. For instance, if sending and receiving JSON, Amplify prefers the API Gateway endpoint to other mechanisms so when you want to set up an API, it's going to give you a couple of options and then it's going to make a lot of implementation decisions for you.
Also, declarative actions. This is a way that it specifies what's being done over necessarily how it's being done. So maybe you're going to send an object, that's fine and everybody understands what it might mean to send an object to the server, but it doesn't specify how. Things like upload over TCP/IP or anything. Also it has the concept or principle of cascading server interaction. In this way, it has some services that are primary and some that are secondary. So for example, while your API might be over the API Gateway, when you go to upload a file, it's going to use an S3 bucket.
Again, this is opinionated implementations in the form of cascading service interaction. The final principle is simple, standard data objects. It uses a lot of things like JSON and handles a lot of things for you in the background. So when you go to upload something to the bucket, the standard parameters, things like bucket name, stream names, partition keys, those sort of parameters, are extracted from a simplified configuration file. This way we have one configuration file that'll be developed for us and all of the configuration settings, keys, bucket names, ARNs, and so forth, will be stored in that file and the configuration classes will handle it for us.
So overall, I just want to encourage you to read these types of things about Amplify to understand how they're doing some of the things and how they are opinionated. And it's an opinion I like, I enjoy the way that they make these decisions for me and chances are, whenever I've gone in to look at them, they've made the decision that I wanted them to make or something better than I probably would have made. These principles can really help you understand why things work the way they do, with Amplify, and the decisions that are made using the command line interface.
- Working with the Amplify toolchain
- Creating a React app
- Adding analytics to a React app with Amplify
- User authentication via AWS
- Using Amplify to simplify account creation and management
- Creating a GraphQL API
- Storing files online