Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

GoogleCloudPlatform/monolith-to-microservices-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Refactoring a monolithic application to microservices

This repository contains the code used in the tutorials Inter-service communication in a microservices setup and Distributed tracing in a microservices application.

This tutorial series uses the example of a dummy ecommerce application and walks through the steps of converting the monolithic application to microservices. The tutorial series demonstrates microservices development using Strangler Pattern for checkout and payment flows in the example ecommerce application. Other details covered include distributed transactions spanning across microservices boundaries, implementing compensating transactions using Sagas, isolating microservices using gRPC, and OpenCensus/Stackdriver based distributed tracing for a polyglot application running different protocols (HTTP and gRPC).

The examples included in the tutorial series come with pre-configured images for easy installation. However, if you wish to change the code and rebuild the container images, run the following:

cd <directory-where-Dockerfile-is-located>
gcloud builds submit --tag gcr.io/<project-id>/<image-url>

For example,

cd microservices/recommendation-services
gcloud builds submit --tag gcr.io/<project-id>/ecomm-recommendation

The image-urls used in the tutorials can be found in the respective deployment files under monolith/ and microservices/kube/ directories. For more details on running gcloud builds, read building container images on Google Cloud. If you choose to run your container images, make sure that the project-id is changed accordingly in the respective deployment files.

Disclaimer

This is not an officially supported Google product.