Online Boutique: A Cloud-Native Microservices Demo Application

Online Boutique is a sophisticated, cloud-first microservices demo application designed to showcase modern application development using Google Cloud technologies. This web-based e-commerce platform allows users to browse a catalog of items, add products to their shopping carts, and complete purchases, simulating a real online shopping experience.

Developed by Google, Online Boutique serves as a practical demonstration of how developers can modernize enterprise applications by leveraging various Google Cloud products. These include: Google Kubernetes Engine (GKE) for container orchestration, Cloud Service Mesh (CSM) for managing microservices, gRPC for inter-service communication, Cloud Operations for monitoring and logging, Spanner, Memorystore, AlloyDB for data storage and management, and Gemini for AI integration. Importantly, Online Boutique is designed to be versatile and can be deployed on any Kubernetes cluster, making it a flexible tool for learning and experimentation.

If you find this demo application valuable, please show your support by giving this repository a ★Star!

Note for Googlers: For internal information, please fill out the form at go/microservices-demo.

Architecture of the Online Boutique

Online Boutique is built upon a foundation of 11 distinct microservices, each written in different programming languages. These microservices communicate with one another using gRPC, a high-performance, open-source universal RPC framework. This architecture exemplifies a modern, distributed system, common in today’s cloud environments.

Alt text: Online Boutique microservices architecture diagram illustrating 11 services in different languages communicating via gRPC, showcasing a cloud-native application design.

Detailed Protocol Buffers Descriptions are available in the ./protos directory for developers looking to understand the API contracts between services.

The table below provides a breakdown of each microservice within the Online Boutique:

Service Language Description
frontend Go Serves the website via an HTTP server. User sessions are automatically generated, and no signup/login is required, simplifying the user experience.
cartservice C# Manages user shopping carts, storing and retrieving items in Redis for persistent cart data.
productcatalogservice Go Provides the product catalog, sourcing data from a JSON file. Enables product search and retrieval of individual product details.
currencyservice Node.js Handles currency conversions using real-time exchange rates from the European Central Bank. This service experiences the highest query per second (QPS) in the application.
paymentservice Node.js Processes payment transactions, using mock credit card information, and returns a transaction ID upon successful charge.
shippingservice Go Calculates shipping cost estimates based on the items in the shopping cart and simulates item shipment to a provided address.
emailservice Python Sends order confirmation emails to users (mock implementation), providing feedback on successful order placement.
checkoutservice Go Orchestrates the order process. Retrieves user cart details, coordinates payment and shipping, and triggers email notifications to finalize the order.
recommendationservice Python Offers product recommendations based on the items currently in the user’s shopping cart, enhancing the user’s browsing experience.
adservice Java Delivers context-based text advertisements, tailoring promotions based on keywords related to user activity.
loadgenerator Python/Locust Simulates realistic user shopping traffic to the frontend, allowing for performance testing and load management analysis.

Online Boutique in Action: Screenshots

To give you a visual understanding of the Online Boutique, here are screenshots of the application:

Home Page Checkout Screen

Alt text Home Page: Online Boutique homepage screenshot displaying product listings and navigation, illustrating the user interface of the online store demo.

Alt text Checkout Screen: Online Boutique checkout screen screenshot showing order summary and payment options, demonstrating the purchase process in the microservices demo application.

Quick Start Guide to Deploying Online Boutique on GKE

Ready to deploy your own instance of Online Boutique? Follow this quick start guide for deployment on Google Kubernetes Engine (GKE):

  1. Prerequisites: Ensure you have the following:

    • A Google Cloud project.
    • A shell environment configured with gcloud, git, and kubectl command-line tools.
  2. Clone the Repository: Clone the latest major version of the Online Boutique repository.

     git clone --depth 1 --branch v0 https://github.com/GoogleCloudPlatform/microservices-demo.git <span>cd</span> microservices-demo/

    The --depth 1 argument optimizes cloning by skipping download of git history, speeding up the process.

  3. Set Google Cloud Project and Enable GKE API: Configure your Google Cloud project and region settings and enable the Google Kubernetes Engine API.

     <span>export</span> PROJECT_ID=<span>YOUR_PROJECT_ID</span> <span>export</span> REGION=us-central1 gcloud services <span>enable</span> container.googleapis.com  --project=<span>${PROJECT_ID}</span>

    Replace YOUR_PROJECT_ID with your actual Google Cloud project ID.

  4. Create a GKE Cluster: Create a Google Kubernetes Engine cluster and obtain the necessary credentials.

     gcloud container clusters create-auto online-boutique  --project=<span>${PROJECT_ID}</span> --region=<span>${REGION}</span>

    Cluster creation may take several minutes to complete.

  5. Deploy Online Boutique: Deploy the Online Boutique application to your newly created GKE cluster using the provided Kubernetes manifests.

     kubectl apply -f ./release/kubernetes-manifests.yaml
  6. Monitor Pod Readiness: Check the status of the pods to ensure they are ready and running.

     kubectl get pods

    After a few minutes, all pods should transition to a Running state, indicating successful deployment:

     NAME READY STATUS RESTARTS AGE adservice-76bdd69666-ckc5j 1/1 Running 0 2m58s cartservice-66d497c6b7-dp5jr 1/1 Running 0 2m59s checkoutservice-666c784bd6-4jd22 1/1 Running 0 3m1s currencyservice-5d5d496984-4jmd7 1/1 Running 0 2m59s emailservice-667457d9d6-75jcq 1/1 Running 0 3m2s frontend-6b8d69b9fb-wjqdg 1/1 Running 0 3m1s loadgenerator-665b5cd444-gwqdq 1/1 Running 0 3m paymentservice-68596d6dd6-bf6bv 1/1 Running 0 3m productcatalogservice-557d474574-888kr 1/1 Running 0 3m recommendationservice-69c56b74d4-7z8r5 1/1 Running 0 3m1s redis-cart-5f59546cdd-5jnqf 1/1 Running 0 2m58s shippingservice-6ccc89f8fd-v686r 1/1 Running 0 2m58s
  7. Access the Online Boutique Frontend: Retrieve the external IP address of the frontend service and access the Online Boutique in your web browser.

     kubectl get service frontend-external <span>|</span> awk <span><span>'</span>{print $4}<span>'</span></span>

    Navigate to http://EXTERNAL_IP in a web browser to interact with your deployed Online Boutique.

  8. Congratulations! You have successfully deployed the default Online Boutique. For deploying variations with features like Google Cloud Operations tracing or Istio, refer to Deploy Online Boutique variations with Kustomize.

  9. Clean Up: Once you are finished experimenting, delete the GKE cluster to avoid incurring further charges.

     gcloud container clusters delete online-boutique  --project=<span>${PROJECT_ID}</span> --region=<span>${REGION}</span>

    Cluster deletion may also take a few minutes.

Explore More Deployment Options

[Link to documentation on additional deployment options will be added here]

Further Documentation

[Link to comprehensive documentation will be added here]

Discover Demos Featuring Online Boutique

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *