Should You Use Firebase or AWS Amplify?

Should You Use Firebase or AWS Amplify?

They're both great platforms but which should you go with?

So the Hashnode-AWS Amplify hackathon is over and, I must say, it was amazing! I got to build something I enjoyed working on (and I'm still working on, more news on that soon) and I got to build with tech I'm not very familiar with and I got to put together something that works. Yay me! However, after I was done with the project, I had to assess the benefits of AWS Amplify against the benefits of a similar platform that I'm way more familiar with: Firebase.

If you're familiar with both platforms, you'd think they're the same service from different tech giants and, you wouldn't be completely wrong. They both offer a quick and easy way to get started on your apps without having to worry about complex cloud infrastructure setups. Much of the work is done for you so you can focus on building and deploying. However, that's about how similar they are. From that point on, they have very different ideas about how they implement this.

The Key Difference

caleb-jones-J3JMyXWQHXU-unsplash (1).jpg

Right off the bat, I could tell there were major differences between how both platforms work. Firebase is a very gentle, hold your-handsy, do-your-assignment-while-you're-asleep kinda mom. Amplify is also gentle but stays up to make sure you get your assignments done by yourself so you know how to do it without help next time. Both methods are great though, depending on your skillset, your willingness to learn and where you're going with the tech you're learning.

Both Firebase and Amplify are layers on Google Cloud Platform and Amazon Web Services, owned by, well, obviously not Microsoft and Apple! As I mentioned before, they try to take much of the work of setting up the underlying infrastructure your app needs. However, where Google is loosely tied to GCP and you can build whole projects without ever seeing the GCP console. However, Amplify is a bit more tightly bound to AWS and much of the initial setup for your Amplify project is done from inside the AWS console. This is the major difference between them, if you ask me, but not the only difference. I'll explore other differences in "who wins" scenarios.

Ease of use | Firebase wins

To be completely honest, Firebase is extremely easy to use. I was up and running on Firebase in a matter of hours. Amplify isn't particularly difficult though and, so long as you are on solid footing with the language/framework you want to use it with, the learning curve should not be particularly steep. However, I must admit that Firebase is very plug and play, where Amplify needs some setting up.

Learning To Use The Cloud Platform | Amplify Wins

I've already stated that Amplify is pretty much closely bound to AWS. This means that to navigate and use Amplify for the most part, you have to find your way around AWS a fair bit. While this might be daunting for a first-timer, you pretty much quickly get a hang of it. The huge advantage this provides you with is that even when you're not using Amplify, you still get to know your way around and how to configure various AWS services like DynamoDB, AppSync, Cognito and others. Firebase's choice to almost abstract GCP's services from you means that if you finally have to tinker around the GCP console, it could be a very strange experience for you.

Project Integration | Firebase Wins

Adding Firebase to a project is a dream, especially for web projects. As I've pointed out, it's pretty much plug-and-play. Copy bits of code provided by the platform and paste them here and there and you're pretty much good to go. Getting started with Amplify on a project is a bit trickier and does require some work. You'll get through it, of course, but it would take a bit more work.

Services Provided | Amplify Wins

Both Amplify and Firebase offer a similar set of services: Authentication, Storage, Hosting and Databases. There are other functions like cloud functions and analytics but these are the core services both offer that most developers would have use for. Firebase's Authentication is great but Amplify's is more flexible and gives you a wider range of options as to how you want to configure user authentication and management. Also, user accounts are managed by Cognito which extends user management to groups and roles. Also, I love how GraphQL is provided out of the box with Amplify. For someone who creates apps for communication, networking and collaboration, GraphQL is absolutely essential. You can also use GraphQL with Firebase but you would have to set up the server yourself which is just extra work when you have a platform that provides it from the start.

Security | I ...... don't know

I have had concerns about security with Firebase given how much of the frontend implementation requires you to publicly paste API keys that can be read by absolutely everyone. I haven't had any security breaches on any Firebase project yet but I still feel skeptical about my API keys just hanging out in my public code.

As for Amplify, well it's still early days so I can't tell. Front-end implementation also requires one or two API keys to be in publicly accessible code and, that still worries me as I like all keys to be on the back end where they're somewhat safer. However, I've reached out to Nader Dabit who happens to be a member of the Amplify team and he says it's safe. Also, a doc he directed me to says those aren't the keys that one would need to carry out a major security breach so I think I'm good on that one.

Recommendations?

Both Firebase and Amplify are great at what they do but choosing one could leave on in a bit of a fix but here's a little cheat to figuring out which to use on a project. If you want something easy with minimal set up, integrates well with other Google services and requiring little tinkering around with the underlying cloud platform, pick Firebase. If, however, you want something that provides more features, gives you access to the full range of the underlying infrastructure and helps familiarize you with the cloud service console it runs on, you should definitely go with Amplify.

Happy building!