This architecture uses click-to-deploy to create an infrastructure to run a three-tier auto scaling web application on GCE using MIG.
At the core of this architecture is the Three-Tier model. Managed Instance Groups (MIGs) are a critical component of auto scaling because they allow you to create a group of identical instances that can be scaled horizontally based on demand. MIGs can directly host monolithic applications without the need for containerization, making them a good option for a lift-and-shift migration if you're not ready to change your entire architecture to containers or microservices. This makes the migration process simpler and faster, as organizations can replicate their existing monolithic application directly onto the instances within the Managed Instance Groups. This approach allows for a seamless transition, minimizing the need for code refactoring or redesigning the application architecture.
To enhance security, this architecture incorporates several Google Cloud services. Cloud NAT enables secure outbound connectivity for instances within the Managed Instance Group, reducing exposure to the public internet and providing additional protection for the application and data. Cloud Armor provides web application firewall (WAF) capabilities, protecting against common web-based threats and ensuring the integrity and availability of the web application.
The combination of auto scaling and security measures makes this architecture ideal for web applications with fluctuating traffic patterns and the need for protection against potential cyber threats. It ensures that the web application remains highly available, even during peak usage periods, while safeguarding sensitive data and maintaining a secure environment.
These are some examples of the use cases you can build on top of this architecture:
- E-commerce Websites : The architecture is well-suited for e-commerce websites that experience fluctuating traffic patterns. During peak shopping seasons or promotional events, the auto scaling feature of the Managed Instance Group ensures that the web application can handle the increased user load without performance degradation.
- Content Management Systems (CMS) : Content-heavy websites or applications that rely on a CMS can benefit from this architecture. The auto scaling capability allows the application to handle varying content creation and publishing demands efficiently.
- Media and Entertainment Websites : Websites or applications that deliver media-rich content, such as streaming platforms, can benefit from this architecture. The auto scaling capability ensures that the platform can handle high traffic volumes during popular events, show releases, or live streaming sessions.
- Lift-and-shift migration : The lift-and-shift strategy is a good option for companies that want to migrate monolithic applications to the cloud without making significant changes to the code or architecture. The strategy is simple, cost-effective and minimizes migration risk.
The main components that we would be setting up are (to learn more about these products, click on the hyperlinks)
- Cloud CDN : Google's content delivery networks—Cloud CDN and Media CDN—scale to bring content closer to a global audience.
- Compute Engine MIG : An instance group is a collection of virtual machine (VM) instances that you can manage as a single entity.
- MemoryStore : Reduce latency with scalable, secure, and highly available in-memory service for Redis and Memcached.
- Cloud SQL : Fully managed relational database service for MySQL, PostgreSQL, and SQL Server with rich extension collections, configuration flags, and developer ecosystems.
- Cloud NAT : Lets certain resources without external IP addresses create outbound connections to the internet.
- Cloud Armor : Help protect your applications and websites against denial of service and web attacks.
- Service Account : A service account is a special kind of account typically used by an application or compute workload, such as a Compute Engine instance, rather than a person.
- Load Balancer: : High performance, scalable load balancing on Google Cloud.
- VPC : Global virtual network that spans all regions. Single VPC for an entire organization, isolated within projects. Increase IP space with no downtime.
Pricing Estimates - We have created a sample estimate based on some usage we see from new startups looking to scale. This estimate would give you an idea of how much this deployment would essentially cost per month at this scale and you extend it to the scale you further prefer. Here's the link.
🕐 Estimated deployment time: 8 min
- Click on Open in Google Cloud Shell button below.
- Run the prerequisites script to enable APIs and set Cloud Build permissions.
sh prereq.sh
- Run the Cloud Build Job
gcloud builds submit . --config build/cloudbuild.yaml
After you deployed the solution, you can check the resources created and see how they work together.
First, go to Google Compute Engine you can see your VMs.
Lastly,go to Cloud LoadBalancing and click on the frontend Load Balancer
You can see all the details of the Load Balancer, and you can copy the Frontend IP section to access the application.
Finally, if you paste the ip and enter in your browser, you see the example application
- Click on Open in Google Cloud Shell button below.
- Run the command below on Cloud Shell to delete the resources.
gcloud builds submit . --config build/cloudbuild_destroy.yaml