CONTAINERIZATION MADE PRACTICAL- A Game Day Schedule Notification Service

CONTAINERIZATION MADE PRACTICAL- A Game Day Schedule Notification Service

·

3 min read

So you can guess what we’re doing on this project just by the title. But there’s a new addition to the normal roster, containerisation.

So what is containerization?

This is a software deployment process that bundles an application’s code with all the files and libraries it needs to run on any infrastructure(AWS)

Containerization helps create easily portable, easily scalable and agile applications, since the container will have all the libraries and dependencies needed to run the application.

Now there are several applications that developers use for containerization eg Docker, Kubernetes(K8), Amazon Elastic Container Service(ECS), Google Kubernetes Engine(GKE) and many more. In this project we will be using both docker and Amazon ECS. Let’s get to know the two individually.

DOCKER:

A virtualisation technology that allows for developers to develop and deploy apps inside neat containerised environments.

Similar to how a virtual machine vitualizes(removes the need to directly manage) server hardware, containers virtualize the operating system of a server. Docker is installed on each server and provides simple commands you can use to build, start, or stop containers.

Key terms:

Docker file- a text document that contains details on how the docker image will be built. Here’s an example from the project:

dockerfile

Docker Image

A read only template that defines your container. It contains the code needed to run including libraries and dependencies.

Docker container:

An instantiated(running) Docker Image

Amazon ECS:

A fully managed container orchestration service that helps to more efficiently deploy, manage and scale containerized applications. AWS allows you to integrate with other services eg Docker and Kubernetes(Amazon Elastic Kubernetes Service)

Key terms:

Cluster: Groups together tasks, and services, and allows for shared capacity and common configurations.

Task definition: Specifies a unique task definition family name

PROJECT:

Challenge: I have created a system that informs me of the NFL game schedules. However, it gets overwhelmed easily and brings up a lot of demands since I must set upvirtual machines to meet specifications.

Solution:

Create a containerised solution that can beattached to load balancers. This way traffic can be distibuted evenly between scaling containers.

In addition, create a REST API that allows for a fresh endpoint that the client uses to request the information.

Here is the architecture for the project:

WORKFLOW:

  1. The client requests for the NFL schedule data.

  2. The request goes through the Sports API generated using the API Gateway from AWS

  3. The AWS-provisioned application load balancer distributes traffic in case there are many requests at once.

  4. The requests are sent to the containers that contain the docker images that are provisioned through the ECS service.

  5. Through the code the request is directed to the third party API which then sends a response with the data.

  6. The data is displayed under the generated endpoint from the sports API.

AWS Architecture:

Amazon API Gateway:

Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale.

Using API Gateway, you can create RESTful APIs and WebSocket APIs that enable real-time two-way communication applications. API Gateway supports containerized and serverless workloads, as well as web applications.

Elastic Load Balancer:

Elastic Load Balancing (ELB) automatically distributes incoming application traffic across multiple targets and virtual appliances in one or more Availability Zones (AZs).

Elastic Container Service(Fargate)

Fargate is the serverless compute engine for containers.

FEATURES

  1. Live stats for the NFL schedule games via the SERPAPI.

  2. Traffic distribution using the Elastic Load Balancer.

  3. Exposing endpoints via API gateway.

  4. Serverless and scalable architecture

Having to interact with these services and understanding the different options has been quite exhiliarating, Here is the github documentation for the whole project:

https://github.com/mbengiivy/NBA-GD-schedule