Explain a 3-tier web app with a database on Google CloudTypeScript
A 3-tier web application architecture separates its functions into three parts: a client-side user interface, a business logic tier (also known as the application tier or logic tier), and a data tier.
Business Logic Tier (Application Tier): This middle part of the application processes the business logic of the application. It takes data input from the user interface, processes it, and sends it to the data tier. This can be created using server-side technologies such as Node.js, Python, or Java.
Data Tier: The bottom level is the database that stores the data of the application. Data is stored, retrieved, and updated in this tier. Google Cloud SQL is a database service quite suitable for this tier.
Your Google Cloud three-tier architecture can include:
- A static website hosted on Google Cloud Storage (front-end tier)
- A web application hosted on Google App Engine (application tier)
- A database hosted on Google Cloud SQL (data tier)
Here's an example TypeScript program that sets up a basic 3-tier architecture.
bucket-websiteis a Google Cloud Storage bucket that will host static website files (Presentation Tier).
- App Engine is set up with
appengine.Applicationto handle computations (Application Tier).
sql.DatabaseInstanceis used to create a Google Cloud SQL PostgreSQL database instance for data storage (Data Tier).