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.
- Memorystore: A service that provides application caching using a scalable, secure, and highly available in-memory service for Redis and Memcached.
Architecture
The following is the request processing flow of the application:
- 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.
- The frontend sends requests to an API layer, which is also deployed as a Cloud Run service.
- Data that is read frequently is cached in and served from a Memorystore for Redis instance.
- Requests that can't be served from the in-memory Redis cache are sent by the API layer to a Cloud SQL database.