Three-tier web app template

This guide helps you understand the Three-tier web app application template, which helps you quickly deploy a three-tier web application stack to Google Cloud.

The three-tier web app includes the following:

  • Containerized apps that are deployed as serverless services:
    • A web-based frontend.
    • An API layer in the middle tier.
  • A SQL database backend.
  • An in-memory cache that serves frequently accessed data.

Products used

The application contains the following Google Cloud products:

  • Cloud Run: A fully managed service that lets you build and deploy serverless containerized apps. Google Cloud handles scaling and other infrastructure tasks so that you can focus on the business logic of your code.
  • Cloud SQL: A fully managed PostgreSQL database in Google Cloud. This frees you from database administration tasks so that you have more time to manage your data.
  • Memorystore for Redis: A service that provides application caching using a scalable, secure, and highly available in-memory service for Redis. This helps you provide low latency access and high throughput for heavily accessed data.

Architecture

The following image shows the components and connections in the application:

A three-tier web application in the design canvas. The application includes frontend, backend, and database components.

The following is the request processing flow of the application:

  1. A web-based frontend receives requests from clients. The frontend is a Cloud Run service, which renders an HTML client in the user's browser.
  2. The frontend sends requests to an API layer, which is also deployed as a Cloud Run service.
  3. Memorystore for Redis caches and serves frequently read data.
  4. The API layer sends requests that it can't serve from the in-memory Redis cache to a Cloud SQL database.

What's next