Cloud Chat Service using Microservices

Weekly Cloud Computing Assignment, Spring 2019

Fault-tolerant micro-services on GCP and Azure implemented using Spring framework and Redis PubSub containerized using Docker and Kubernetes.

Overview

Micro-services:

WeChat refers to services as nodes and the connections between services as edges in a directed acyclic graph (DAG). For example, the group chat service will need to call the profile service to retrieve the user’s profile information. By using this architectural pattern, it is possible to modularize each application and independently update, add features, etc. without having to change the design of any of the other microservices.

Architecture:

Technologies used:

  • Java
  • Maven
  • REST
  • Java Spring Suite
  • STOMP
  • Redis Pub/Sub
  • MySQL
  • Docker
  • Kubernetes
  • Helm
  • YAML config
  • Google Container Registry
  • Google Kubernetes Engine
  • Azure Kubernetes Cluster
  • Weave-scope
  • Terraform
  • GCP
  • Azure

Docker & Kubernetes

To start, I packaged the Profile service as a Docker image and has a container running on a Kubernetes cluster in the cloud, so that the service can be made available to external clients. Docker images were being pushed to the Google Container Registry (GCR) and applications were deployed to the Google Kubernetes Engine (GKE).

The profile service was migrated from an embedded database to a remote MySQL database using Helm to deploy and configure applications with ease.

Stomp / WebSockets is the primary technology used by the group chat service to enable real-time communications. WebSocket is better than raw HTTP connections for the chat room use case as they provide a two-way full-duplex connection between the client and server.

I used Kubernetes features to horizontally scale the applications based on pod metrics (Horizontal Pod Autoscaler (HPA)).

Outcome

Visualization using weave-scope to understand, manage and troubleshoot:

Learnings

Built, deployed, managed, and administered Docker containers and Kubernetes clusters.

Developed Dockerfiles in order to containerize a RESTful Spring application.

Created and used container registries in order to use custom Docker images in their applications.

Compared working with Kubernetes clusters and deploy applications to multiple clouds.

Identified downstream service failures. Routed traffic away from a failed cluster and be able to scale up a service in the healthy cluster using autoscaling rules.

Created and deployed Helm charts to manage Kubernetes applications.

Developed and deployed real-time and scalable web services using the microservices pattern.

More Details

Academic Integrity restricts me to go into details about the implementation and my unique approach to the project. If you would like to learn about the details, please contact me.
I'm always happy to chat.