Prepare and test your skills

Prepare and test your skills

Application modernization with containers and microservices is the shift from large, hard-to-change applications to small, portable services that release faster and cost less to run. A container (opens in a new tab) is a lightweight package that holds an application and all its dependencies so it runs the same way in every environment. A microservice (opens in a new tab) is a small service that can be deployed and scaled on its own, and a microservices architecture breaks a monolith into many focused services. On Google Cloud, Google Kubernetes Engine (GKE) (opens in a new tab) and Cloud Run run containerized microservices, while Migrate to Containers (opens in a new tab) converts virtual machine (VM)-based applications into containers.
Containers and microservices are the core building blocks of modernization because they change how software is packaged, deployed, and scaled. Containers are lighter than VMs because they do not include a full operating system, so they need less compute and memory and can be packed densely onto hosts. Microservices split a monolith into independent services that can be updated and scaled separately without rebuilding the whole application. Kubernetes and GKE organize this work with Pods, Services, Deployments, and replica sets, where a microservice can run as a Deployment with load-balanced Pods behind a Service. Cloud Run provides a serverless container environment that follows the Knative API and removes the need to manage Kubernetes clusters.
Increased release velocity means teams can build, test, and deploy changes faster and more safely. Containers and microservices support faster releases because each microservice deploys independently, so a change to one service does not require rebuilding the entire monolith. Cloud Build automates the build-test-deploy cycle, including automated builds, tests, environment provisioning, and security vulnerability scans. Image-based management enables rolling updates, dynamic scaling, and self-healing, while GKE adds automated rollouts and rollbacks, health checks, cluster autoscaling, and auto-upgrading. Cloud Run deploys in seconds and provides revisions and traffic splitting, which lets a team release a new version and shift traffic to it gradually.
Optimized resource utilization means the same infrastructure can run more work with less waste. Containers are much lighter than VMs because they do not carry the operating system, so they allow greater workload density, fine-grained resource allocations, and lower infrastructure costs. GKE can pack multiple Pods onto the same VMs, which can reduce the number of VMs and lower Windows licensing costs. Linux containers are more lightweight than Windows containers and run on more platforms more efficiently, which can further reduce cost of ownership. Cloud Run autoscales by default, bills for the duration of the request, and can scale to zero during inactivity, while GKE supports cluster autoscaling and preemptible VMs to reduce costs.
Reduced technical debt means removing outdated dependencies, manual processes, and hard-to-change architecture. Legacy monolithic applications often require managing on-premises Windows and SQL Server, have limited deployment environments and high licensing costs, and are difficult to upgrade and scale. Cloud-native patterns replace self-managed infrastructure with managed services such as Cloud SQL instead of self-hosted SQL Server, MySQL, or Postgres, and Pub/Sub instead of self-hosting MSMQ, RabbitMQ, or Kafka. Teams can also use Identity-Aware Proxy (IAP) instead of coding authentication into the application, and Cloud Key Management Service (Cloud KMS) and Secret Manager instead of storing secrets and keys locally. Migrate to Containers can extract an image from a VM workload and build a Docker image without source-code access or rewriting, which brings modern operations such as CI/CD integration, rolling updates, dynamic scaling, and self-healing.
A modernization path is the strategy a team chooses for each workload, from keeping code as-is to rebuilding it completely. Common approaches are rehost (lift and shift), replatform (lift and optimize), refactor (move and improve), rearchitect (continue to modernize), rebuild (remove and replace), and repurchase. A phased approach can start with rehosting or replatforming and then refactor or rearchitect later. Choose rehost when workloads have few dependencies, are not worth refactoring, or use third-party software. Consider refactor when dependencies must be untangled or automated deployment is difficult, and consider rebuild when workloads no longer meet requirements or rely on end-of-life technology.
For container hosting, the two main options differ in control and management:
| Hosting option | Management model | Scaling and billing | Best fit |
|---|---|---|---|
| Google Kubernetes Engine (GKE) | Managed Kubernetes; you manage nodes and clusters, or GKE Autopilot manages cluster configuration | Cluster autoscaling, auto-repairing, auto-upgrading; charged per node; supports preemptible VMs | Many containers with different requirements, fine-grained control, long-running processes, non-HTTP(S) protocols, or Windows and Linux containers |
| Cloud Run | Serverless containers on Google infrastructure; no Kubernetes cluster to manage | Autoscaled by default; billed for request duration; can scale to zero; deployment in seconds | Stateless HTTP microservices, autoscaled web frontends, event-triggered services |
Exam tip: Cloud Run is the default for stateless HTTP containers, while GKE is the default for long-running processes or applications that use protocols other than HTTP(S).
Microservices agility and scalability describe how quickly separate application components can be changed and how independently they can grow to meet demand. When an application is containerized, each component — such as a Tomcat, Apache2, or Windows IIS application — is packaged as its own container image with its own version and release schedule. This separation lets a team scale, update, or replace one component without rebuilding the rest of the application.
Independent scaling means adjusting the resources for one containerized component until it meets demand without wasting capacity. Load testing is the starting point because it exposes potential breakpoints and shows how the application can be scaled. After that, Cloud Monitoring (opens in a new tab) analyzes trends in performance metrics, measures the effects of experiments, defines alerts for critical metrics, and supports retrospective analyses. Active Assist adds tools that provide insights and recommendations to help optimize resource utilization, adjust resource allocation, and improve performance. Taking advantage of elasticity — the ability to change capacity as demand changes — is the outcome these tools support.
A modular deployment cycle lets one component's image be rebuilt and replaced without touching the other components. The Migrate to Containers (opens in a new tab) modernization plugins follow this pattern, with each plugin image versioned and released separately, including tomcat-discovery, tomcat-extraction, apache, jboss, websphere, wordpress, linux-discovery, linux-extraction, linux-distro, and service-manager-runtime. Releases such as 1.4.11 through 1.4.19 update individual images to fix discovered vulnerabilities, so a fix to one image does not force a rebuild of the others. Updating the Migrate to Containers software layer inside a deployed workload follows an ordered process:
FROM directive to the version you want, for example from 1.0.3 to 1.0.4.Because only the version tag changes, the application content and the runtime layer move on separate schedules.
Exam tip: Changing the FROM version tag in the Dockerfile does not update a running workload by itself; a new workload container image must be built and then applied to existing deployments.
Dependency boundaries make explicit what runs inside a container and which external systems the container depends on. For a Tomcat application container, migration checks flag database connections, web server connections, network mounts, and exported Network File Systems (NFS), and the deployment cluster must be able to reach those external systems. For a Windows IIS application container, the checks flag unsupported Windows versions, virtual directories on network drives, missing virtual directories, application pools using Active Directory identities, and unsupported ASP.NET Core. For an Apache2 application container, the checks flag enabled SSL that is not migrated automatically, unsupported versions, non-default installation locations, and unsupported modules.
The documented checks and actions differ by application type:
| App container | Documented checks | Documented action |
|---|---|---|
| Tomcat | Database connections, web server connections, network mounts, exported NFS, Java endorsed dirs | Confirm the deployment cluster can reach external databases, web servers, and NFS servers; add endorsed paths to the migration plan and Dockerfile |
| Windows IIS | Windows version, virtual directories, application pool identities, ASP.NET Core | Upgrade Windows, move virtual directories to a local drive or exclude them, configure a Group Managed Service Account (GMSA) |
| Apache2 | SSL, version, installation location, unsupported modules | Configure SSL manually, use Apache 2.4, move the configuration directory to /etc/apache2 on Ubuntu/Debian or /etc/httpd on CentOS |
Because each component is checked, versioned, and updated as its own image, a change to one component is built and applied to that component's deployment rather than to the whole application.
Container portability and consistency is the ability to run the same application the same way in every environment. A container achieves this by packaging the application together with its dependencies into one lightweight, standalone unit. Because the package carries what the app needs to run, it behaves in a consistent and predictable way across development, testing, and production, including on Google Cloud targets such as Google Kubernetes Engine (GKE) (opens in a new tab) and Cloud Run.
A container is a lightweight, standalone, executable package that includes everything needed to run an app in one place. The application and its dependencies travel together, so the host environment does not have to be manually configured to match. This bundled package is what removes most “it works here but not there” problems.
The package typically includes peer parts that run together:
Because these parts move as one image, the workflow depends on the container image rather than on a hand-built server.
Container consistency means development, testing, and production all run the same immutable artifact. Teams build the container image once, test that exact image, and then promote that same image forward instead of rebuilding the app for each environment. This eliminates configuration drift where servers slowly become different from one another.
A three-step process flow showing one immutable container image promoted from Development to Quality Assurance to Production, so production runs the exact artifact that passed testing.
Promotion follows the same image from source to destination in order:
Because the same artifact passed through multiple rounds of testing, production has a lower chance of surprise failures. Compared with running an application directly on a virtual machine (VM), containers are also more efficient when multiple containers share the same host.
Container portability means the same containerized workload can run in various environments without reworking the application. A container does not include a full operating system, so it is much lighter than a VM and needs fewer compute and memory resources. That lightness allows greater workload density, fine-grained resource allocation, and easier movement between clusters and platforms.
On Google Cloud, portable containers can run on GKE, GKE Autopilot clusters, GKE Enterprise, Cloud Run, and containers on Compute Engine. Migrate to Containers (opens in a new tab) supports this move by extracting an image from an existing VM workload and constructing a Docker image and related artifacts. Modernization can therefore happen without access to source code, rewriting, or rearchitecting the application.
Exam tip: A VM migration moves the whole machine including its operating system, while a container moves the app plus its dependencies without the operating system.
Lift-and-shift and container migration differ in what they preserve and where the workload lands. Lift-and-shift keeps the existing VM operational model and only changes the underlying infrastructure. Container migration changes the operational model to image-based management and orchestration.
| Approach | Target platform | What changes |
|---|---|---|
| Lift-and-shift with Migrate to VMs | VM instances in Compute Engine | Preserves the on-premises way of running and managing apps; modernizes only infrastructure |
| Modernize with Migrate to Containers | GKE, GKE Autopilot, GKE Enterprise, or Cloud Run | Converts VM workloads to containers for modern orchestration without requiring source-code rewrite |
Image-based management then enables rolling updates, dynamic scaling, self-healing, and integration with continuous integration and continuous delivery (CI/CD) tools such as Cloud Build (opens in a new tab). The result is deployment flexibility where teams can choose where and when to deploy while keeping behavior consistent.
Cloud Run is the default for stateless HTTP containers because it is serverless with no Kubernetes cluster to manage, autoscales by default, bills for request duration, can scale to zero, and deploys in seconds. Google Kubernetes Engine (GKE) is the default for long-running processes or applications that use protocols other than HTTP(S) because it provides managed Kubernetes with fine-grained control for many containers with different requirements.
Containers and microservices support faster releases because each microservice deploys independently so a change to one service does not require rebuilding the entire monolith, enabling rolling updates, automated rollouts and rollbacks, and traffic splitting. They lower costs because containers are lighter than a virtual machine (VM) since they do not include a full operating system, which allows greater workload density, fine-grained resource allocation, and autoscaling including scale to zero.
Migrate to Containers extracts an image from a virtual machine (VM) workload and builds a Docker image and related artifacts without requiring source-code access, rewriting, or rearchitecting. The converted workload can then run on Google Kubernetes Engine (GKE) or Cloud Run with modern operations such as continuous integration and continuous delivery integration, rolling updates, dynamic scaling, and self-healing.
Updating a containerized workload requires editing the Dockerfile and changing the version tag in the FROM directive, building a new workload container image version from the updated Dockerfile, and then applying the new image to existing deployments. Changing the FROM version tag alone does not update a running workload by itself.
A retail company currently operates a large, monolithic e-commerce application. During promotional sales, spikes in checkout traffic force the engineering team to scale the entire application, which significantly increases infrastructure costs. Additionally, a minor bug in the product recommendation feature recently caused the entire website to crash, and deploying new features requires coordinating all development teams for a single monthly release.
The company wants to modernize its application to achieve the following business and technical goals:
Which architectural approach should the company adopt to meet these requirements?
Last updated