Fragments!

Fragments

is a cloud-based microservice made with AWS services. This was our main assignments throughout the semester for CCP555 (which Dave also teaches) Gradually implementing Amazon web services to a basic web app made with nodeJS. 

Fragments is a web app made to store and distribute small text and image files for a rhetorical company that require the fragments microservice to support their new system. As for it's architecture, it's pretty simple. At its core, its an express app, built to serve as an HTTP REST API for all the fragment operations. I'll try and detail the Amazon web Services used to support the app.

Amazon Cognito

So for authorization (which I've learned in this course is the most 'necessarily' complex topic to learn) we used Amazon's Cognito service. Cognito is so great for simplifying a lot of the authorization process instead of having to build it yourself from the ground up. In addition to the authentication that it provides, it stores user data so that you don't have to, and has a built in UI for logging in. It's a great service and provides the login/registration for the fragments-ui, and authentication for the fragment service.

S3 (Simple Storage Service)

S3 is one of the most popular Amazon web services. We use it for storing our raw fragment data(blobs). S3 is one of the leading data storage services used in today's web apps since it is highly durable, lots of storage, and a very cost efficient service. It uses key/value pairs to manage and store objects (i.e., arbitrary blobs of binary data) 

DynamoDB

However we still need to store our metadata elsewhere, so instead of converting a json object to a blob and storing it in s3, a more suitable way would be to store it in Amazon's DynamoDB, a fully managed NoSQL database. It's similar to MongoDB where it is a key/value datastore. An item in DynamoDB is similar to a record on a table, they are made up of attributes which are our metadata info. We use the id, and ownerId of the fragment as the composite keys.

Elastic Beanstalk

Lastly, I'll talk about elastic beanstalk. It's a platform a service(Paas) used to host our fragments microservice. What it basically does is start a EC2 container according to your specs, and setup its own DNS address as an endpoint for our web app. (I would post my healthcheck url, but all my AWS resources will expire at the end of the semester) Using CloudWatch we can also keep logs of our app to debug in case it crashes.

Summary

After my newfound experiences with all these Amazon web services, I've really come to understand why its the leading cloud service currently. It's got cheap, efficient, and highly durable technology that web developers can take advantage of rather than building each of those components from the ground up. I had a great learning experience building fragments, (it's akin to the time we made the link checker CLI app that Dave had us do for OSD600, 2 years ago)

There were a few more services that were used regarding like Elastic Container Registry to store Docker Images, EC2 to start up VM instances, and more but it wasn't as relevant to this topic (about fragments and how its built) So I'm saving it for another post :)

Thanks for reading

Comments

Popular posts from this blog

Release 0.3 : Telescope and The Quest for Infinity.... Scroll

Introduction

Week 1 + 2 Recaps and thoughts