Best practices for designing applications

This guide provides best practices for designing and defining your applications within App Hub. Effective application design is key to utilizing the full benefits of Application-centric Google Cloud, offering enhanced visibility, governance, and operational efficiency.

Core principles of application design

Adhering to the following core principles helps you create applications that are robust, maintainable, and aligned with your business objectives, maximizing the value you get from App Hub:

  • Reflect business capabilities: Define App Hub applications around business functions or end-to-end workflows, rather than just technical layers or individual microservices. An application should represent a distinct value stream for the business.

  • Determine clear ownership: Assign clear properties and attributes to each application, supporting discoverability and governance. Particularly, adding application owners fosters accountability and streamlines communication.

  • Consider application boundaries: Define boundaries that make sense for operations, monitoring, and governance. Resources within an application should ideally share a common operational lifecycle and impact domain to simplify management and reduce operational risk.

    When considering the boundaries of your application for operational purposes, it's important to understand how Google Cloud Observability structures data collection and display. While App Hub focuses on application boundaries, Google Cloud Observability uses scopes to define which telemetry data is visible and analyzable across projects. The configuration of these observability scopes has a specific relationship with your host project or management project, determining how you can aggregate and view telemetry data from different projects. To learn more about how to configure these for a unified view, see Configure observability scopes.

  • Adapt to evolution: Design your applications to accommodate future changes and growth in your architecture.

  • Refine iteratively: Regularly review and adjust your applications to reflect changes in your organization's structure, teams, and business priorities.

What to define as an application

Understanding what constitutes an application in App Hub is fundamental to effectively integrating application management capabilities in Google Cloud. An application groups services and workloads that collectively deliver a specific business function. For more information on the core concepts of applications, services, and workloads in App Hub, see Concepts and data model.

To help you determine the appropriate boundary for your App Hub applications, consider the following key questions:

  • What user or business value does this collection of resources provide?
  • Do these components share a common operational lifecycle?
  • Is there clear, unified ownership across these resources?
  • Does this grouping facilitate effective monitoring and troubleshooting?

Example: OpenTelemetry demo architecture

The OpenTelemetry demo architecture represents an ecommerce system that includes microservices such as Ad, Cart, and Checkout. To best define this application in App Hub, consider the following recommendations:

  • Model the entire ecommerce system as one App Hub application, for example, my-ecommerce-site:

    • The individual microservices' compute instances, such as Google Kubernetes Engine (GKE) deployments, map to App Hub workloads.
    • The network endpoints, such as load-balanced gRPC/HTTP interfaces, map to App Hub services.
  • Avoid registering each microservice, such as Ad, Cart, and Checkout, as its own App Hub application. This approach fragments the business context.

For more information on infrastructure resources that App Hub supports as services and workloads, see App Hub supported resources.

Design strategies

Employ the following design strategies to make sure your App Hub setup is scalable, governable, and aligned with your operational practices.

Choose between global and regional applications

When designing your App Hub applications, a fundamental decision is whether to define them as global or regional. This choice impacts which resources can be included, data handling, latency, cost, and compliance:

  • Global applications are best suited for services and workloads that are inherently distributed across multiple Google Cloud regions or rely on global resources like a global Application Load Balancer.
  • Regional applications are recommended when all application components reside within a single Google Cloud region. This practice is generally the best approach if your architecture allows it.

The following list of best practices can help you choose between global and regional applications:

  • Prioritize regional applications: Whenever possible, design your applications as regional to take advantage of benefits like reduced latency, potential cost savings on inter-region network traffic, alignment with data locality requirements, and inherent compatibility with region-specific Google Cloud features and failure domains.
  • Use global applications strategically: Opt for global applications only when your system components are necessarily spread across regions or involve global Google Cloud services.
  • Decompose multi-region systems: If you have resources in multiple regions that don't form a single cohesive global function, consider defining separate regional applications for the resources within each respective region. This practice maximizes the benefits of regionalization for each deployment.

For a detailed comparison and a deeper dive into the implications of this choice, see Global and regional applications.

Define environments as separate applications

You can represent different deployment environments as distinct App Hub applications. This approach provides strong isolation for security, permissions, and operational risk, preventing accidental impacts across environments.

For example, you could structure your applications as my-app-dev, my-app-staging, and my-app-prod for development, staging, and production environments, respectively.

While you can use the Environment attribute within a single application to tag resources, separating environments into distinct applications offers precise boundaries for access control, policy enforcement, and monitoring. You must still use the Environment attribute consistently on the resources within these environment-specific applications to provide granular detail and further specify roles. For more information on this and other attributes, see Use attributes for governance.

Align with team structures

Consider aligning application boundaries with the teams responsible for their development and operation. This practice can simplify ownership and communication because the application model in App Hub mirrors your organization's structure.

Use attributes for governance

Consistently apply attributes to all application resources to enhance discoverability and enforce governance. These attributes provide rich metadata for filtering, reporting, and policy application:

  • Criticality: Helps prioritize resources for monitoring and incident response.
  • Environment: Supports filtering and environment-specific policies.
  • Owners: Provides visibility and accountability.

Establish organizational standards for tagging resources with these attributes. For more details, see Support discoverability and governance.

Identify application management use cases

Integrate App Hub with Application Design Center for a seamless application lifecycle experience, from design to operations:

  • You have pre-existing resources to register as an application: Register existing Google Cloud resources from your setup model to an application in App Hub to gain unified visibility and operational control.
  • You don't have pre-existing resources to register as an application: Use Application Design Center to design and deploy new applications. Application Design Center automatically registers the deployed resources in App Hub, so your model accurately reflects the intended design. Application Design Center also helps you manage application updates. When an application template changes, you can update any instances that are based on the template, which lets you make sure application updates are consistent.

Resource hierarchy

The standard Google Cloud resource hierarchy consists of organization, folder, and project resources. App Hub introduces an application management layer on top of that hierarchy through the concept of app-enabled folders and host projects, depending on your setup model.

Understanding how your chosen setup model fits within your existing Google Cloud resource hierarchy supports effective governance, policy enforcement, and resource discovery. Review recommended structures and plan for your resource hierarchy when choosing your setup model for managing applications.

Continuous refinement

Application designs are not static; they typically evolve with time. Regularly review and refine your applications to make sure they continue to align with your business needs, team structures, and changing architectures.

We recommend using insights from Cloud Hub and Gemini Cloud Assist to identify optimization opportunities and adapt your applications accordingly. Additionally, you can use Application Design Center to manage the lifecycle of your applications. The Deployments page in Cloud Hub shows applications that have available updates from the Application Design Center template they were based on, streamlining the update process.