-
Notifications
You must be signed in to change notification settings - Fork 2
GoogleCloudPlatform microservices demo
Lately, I've been seeking to learn about Microservice Architecture which is very popular nowadays for implementing distrubuted architectures, and when I've been looking through GitHub Explore, I came across microservices-demo repository from GoogleCloudPlatform and it satified my curiosity.
Google Cloud Platform is one of the current most popular Cloud Platforms which provides you with services to easily test, deploy and intagrate your projects as a distrubuted architecture. However, since it includes lots of different APIs and services, it gets very confusing to find out where to start.
For following Option 1 - Running Locally, you only need your PC / Mac, and need to download these free libraries: gcloud
, kubectl
, skaffold
, docker
Then, you should clone the repository and run the project as documented in the repository readme.
For following Option 2 - Running on Google Kubernetes Engine, you need to open up an account Google Cloud Platform Account and provide a valid credit card to earn 300$ free credits for Google Cloud Platform. Then, you can open up a new project in GCP and follow the documentation in the repository readme to run the project in a public environment. Afterwards, you should install the libraries specified in the Option 1. Then, you should clone the repository and run the project as documented in the repository readme.
My advice is to go through option 1 to install necessary tools, then quickly go to option 2 deploy, otherwise it will require ~20 GB disk space to run a fully functional Docker Image. Note, you should run the commands in step 3 of option 2 in Google Shell (online, in browser) not in your own system's terminal.
microservices-demo is an awesome demo which helps you through a quick start to microservices architecture as well as helping you learn to use below libraries, as well as helping you grasp the logic behind the microservice architecture: 1- Kubernetes/GKE 2- gRPC 3- Docker
Finishing up Option 1 - Running Locally to deploy the project, took me around 40 minutes (~20 minutes of it, waiting for it to build the project) including installing the prerequisites
Finishing up Option 2 - Running on Google Kubernetes Engine](https://github.com/GoogleCloudPlatform/microservices-demo#option-2-running-on-google-kubernetes-engine-gke) to deploy the project was much faster, since I've already built the project in option 1.
Then, I've checked out the folder structure, skimmed over kubernetes configurations for each microservice. Then, I've checked out how the messaging protocols are used/defined via gRPC. Finally, I've skimmed over how each microservice is separately written in different languages but with common grounds only in .proto
definitions for inter-messaging.
After all, I've learned that once the messaging protocols are implemented in a neat way, each developer/team can work on one microservice in any language without having to know about anything about implementation details of the other services, but only the .proto
definitions used in messaging protocols. What's more, since each service is used in a different kubernetes, they can be easily scaled up or down, independently to each other. (Check out the /kubernetes-manifests
folder in the repository to look at how resources for each service is defined/limited)
This repository provides a super quick-start to deploying a system using microservices and watching it work in live. It provides a general overview about Microservices Architecture in practice. Usua lly, it's hard to get understand how a big system works, but this repository provides an example system where you can inspect its work one microservice at a time, as well as how they work in combined. Finally, the sample system is not a small/half-finished sample project, but a fully functional distrubed system, so you get to have an idea about what an End-Product looks like.