Java Application Deployment

Deploy a Java application to Google Cloud

Deploy a Java application to Google Cloud runtime environments.
New customers get $300 in free credits to spend deploying this solution
Who this is for
Application Developers, DevOps Engineers
How you'll deploy
Once you've signed up for Google Cloud, you can deploy through the console.
Overview

What is a Java application?

A Java application is a software program written in the general purpose programming language called Java. Common Java libraries (e.g. Apache Commons IO, Jackson Databind, JUnit, etc) are used to write the software program and tools like Maven and Gradle are used to compile and build it. The built software is run using the Java Virtual Machine runtime. This software program may be stand-alone or distributed in nature and can function either as a client or a server. For this solution, we focus on a standalone Java application that runs as a server

What are some examples of Java applications?

Java is one of the most popular programming languages that are widely used to build a variety of applications such as web, mobile, gaming and desktop applications. It is used extensively in enterprise software development for developing large-scale, mission-critical applications.

What are some benefits of Java?

Java is object-oriented allowing you to create modular programs and reuse your code and leverage object-oriented concepts like encapsulation, abstraction, and inheritance. In addition, Java's ability to manage its own memory allocation helps increase the security of Java applications and allows developers to focus on business logic. The growth of the Java developer community has brought about many useful general purpose libraries that are free and open source. Thus, developers have the choice of choosing from a wide range of libraries when building their applications.

Java is also platform-independent. So, you can deploy your code on many different platforms without needing to modify the code.

What are the key steps to building and deploying a Java app?

The key steps of building and deploying a Java application include code compiling, packaging, setting up the deployment environment, deploying your packaged Java application to your runtime of choice, and testing your application.
Solution Details

Deploy a Java application to Compute Engine VMs

Create a multi-region, load balanced set of VMs to run a Java application, backed by Cloud SQL.

Solution Architecture:
  1. User requests are routed to Cloud Load Balancing.
  2. The request enters the Virtual Private Cloud (VPC) network.
  3. Requests are filtered by the Cloud Firewall Rules. If they match Forwarding rules, requests are routed to a backend based on the request URL.
  4. The Java application runs on a compute runtime backend. In this solution, the backend is a Managed Instance Group (MIG) with auto scaling enabled. Thus, as the request load increases the MIG will automatically scale the number of Compute Engine instances that process requests and enable load balancing across all instances.
  5. Cloud SQL for MySQL is used as the relational database backend for the Java application with a primary and secondary for redundancy.
  6. Compute Engine can also access files that are stored in Cloud Storage or Filestore as needed. Cloud Storage is used to store static content related to the application. Filestore is used to store the XWiki pages in a filesystem structure.
Google Cloud
  • ‪English‬
  • ‪Deutsch‬
  • ‪Español‬
  • ‪Español (Latinoamérica)‬
  • ‪Français‬
  • ‪Indonesia‬
  • ‪Italiano‬
  • ‪Português (Brasil)‬
  • ‪简体中文‬
  • ‪繁體中文‬
  • ‪日本語‬
  • ‪한국어‬
Console
Google Cloud