Different Microservices & Cloud Native Architecture flavors & how Google Cloud supports those flavors?

Rania Mohamed
Google Cloud - Community
8 min readJul 27, 2020

Lots of Architects and developers believe that building Microservices Architecture (MSA) or Cloud Native Architecture (CNA) would only consider one single architecture pattern though that is not true :). It is the opposite; CNA/MSA Architecture is a blend of multiple Architecture patterns and not just as simple as applying a CNA/MSA pattern. Let us start by exploring some of those architecture patterns:

  • Event Driven Architecture (EDA), is the pattern enabling the service to service communication via events and handling data changes as events. It highly supports loosely coupling and autonomous design principles.
  • Serverless, is the pattern which enables running services without operating and maintaining any servers or any infrastructure. Additionally, it enables scaling down to zero instances which supports efficient pay as you go, as payment is for the exact execution, running, invocation and compute usage of the service code.
  • Containerization, is the pattern which enables running service code inside a container supporting consistency of the runtime, portability of the service, ease and efficient service instances scalability.
  • Function as a Service (FaaS), is the pattern of running a code snippet as a function in a serverless mode. It supports triggering the function using events or direct API calls.
  • Platform as a Service (PaaS), is the pattern of using a common platform enabling multi-tenancy and supporting auto scaling and self healing. Usually PaaS is offered in a two modes of runtime, the first one at which the PaaS detects and maintains the service code runtime while the second one uses a user defined runtime, through a manifest, to run the service code then maintain and orchestrate it.
  • Service Catalog & Service Broker, are the patterns which enable provisioning backing services, binding them to workloads at the runtime with no downtime or code changes. Additionally, it supports managing services consumption and pricing.
  • API Management & API Gateway, are the patterns of exposing services using a secured and controlled platform. It supports API monetisation, API integration patterns such as Enterprise Integration Patterns (EIP), API policies enforcement and API security and shielding.
  • DevOps, is the pattern of designing and implementing the E2E development and operation process automating the software development lifecycle. It supports defining the software delivery pipeline and phases, considering continuous delivery, and continuous integration. Usually, it implements automation to the highest level, i.e. test automation, self healing, resource consumption optimisation, auto provisioning, and auto scaling.
  • Artificial Intelligence (AI), is the pattern of using Machine learning and data science for implementing smart analytics including predictive and detective analytics. It supports digitising business intelligence.
  • Business Process Automation, is the pattern of automating the business process using business process management (bpmn) and business rules (br). It supports digitising business intelligence.
  • Meshing, is the pattern of enabling distributed tracing, externalising the configuration and quality of service (QoS), metrics and telemetry gathering, log aggregation, dynamic service discovery, traffic management, intelligent & flexible integration including the of support of circuit breaker design pattern, self healing, fault injection and policies enforcement. I always believe that meshing is an important pattern when implementing MSA/CNA as it dilutes MSA/CNA complexities and challenges in the integration and governance that is why it is one of my top favorite topics :).
  • MSA, is the pattern for designing microservices based on business domain services and implementing the design principles of MSA such as state management, loose coupling, decentralisation, autonomous, and resiliency.
  • CNA, is the pattern of natively consuming and communicating with the underlying cloud Infrastructure and implementing the design principles of cloud native apps, such as statelessness, observability and business agility.

Now that we have discussed the main patterns that are mostly required in MSA/CNA solutions let us explore the topic of multi-cloud and hybrid-cloud and their usage in building MSA/CNA.

First, what is multi-cloud and how does it differ from hybrid-cloud?

Multi-cloud is the pattern of distributing the applications across multiple clouds, it can be a set of private and/or public clouds, while hybrid cloud is the pattern of distributing the applications across private and public clouds.

Ok, but still what are the differences?

The main difference is that hybrid cloud pattern is aiming to build one homogeneous and integrated infrastructure from public and private clouds/infrastructure eliminating the redundancy in utilities, common services and Quality of Services (QoS) implementing high governance and control, for example use one single identity management (IdM) to control authentication and authorisation within the whole infrastructure so it is more aiming and enforcing infrastructure & cloud agnostic, while the multi-cloud is a wider concept as it doesn’t enforce the central governance process and elimination of redundancy, so it may involve only public cloud at which each cloud has its own IdM.

Multi-Cloud vs Hybrid Cloud

Yes, but how can multi-cloud and hybrid-cloud help in CNA/MSA solutions?

The idea behind CNA & MSA is to build an application which is intelligent from a business and IT aspects. It adapts to any change in the business and the IT, even if such a change is an unexpected one; it is a more reactive architecture than just a responsive one. CNA/MSA focuses more on the business and targets infrastructure and platform agnostic. Because of that, multi-cloud and hybrid-cloud are important patterns for the expansion and adoption of different infrastructure & service providers (legacy and modern). Additional multi-cloud and hybrid cloud support in the journey of the app modernisation and business digitisation, as bits and pieces of the app are being modernised and migrated from one platform or infrastructure to another.

As we have discussed different architecture & design patterns used in building CNA/MSA solutions let us try and model a sample reference architecture for CNA/MSA solutions bringing all those architecture patterns together, explaining how it all works.

In a typical MSA/CNA solution, a hybrid cloud is used (a combination of public clouds and private cloud or as we used to call it ground), so for simplicity in the presented sample reference architecture we will use one public cloud and one private cloud (more can be added for sure :) ).

Sample CNA/MSA Reference Architecture

The above blueprint depicts the high level reference architecture, let us try and explain it by listing the main architecture principles:

  • Both Public and Private clouds host a PaaS offering, in the both flavors ( fully managed runtime and user defined runtime)
  • Both Public and Private clouds enable containerised workloads (stateless and stateful MSA) in the user defined runtime PaaS offering.
  • Both Public and Private clouds offer FaaS in a serverless mode using the fully managed runtime PaaS offering.
  • DevOps suite (tools and pipelines) is distributed between both Public and Private clouds in a hybrid solution mode.
  • Service Broker(s) and Service Catalog are used to enable dynamic provisioning of all kinds of backing services in the Public & Private clouds including AI services/workloads.
  • Private Cloud is hosting a message broker for asynchronous communications between different MSAes and CNAes, enabling the implementation of EDA.
  • Public Cloud only enables service meshing in the user defined runtime PaaS offering (this is just an example to show that service meshing can be enabled on a PaaS and disabled on another in the same cloud, it all depends on the needs :)).
  • Private cloud enables service meshing on both PaaS offerings.
  • Some of the deployed CNAes and MSAes are hosted in a serverless mode.
  • Private Cloud hosts Business Rules and Business Process Management Runtime for orchestrating the business functions/steps offered by the implemented CNAes & MSAes.
  • Business Processes Runtime communicates with the MSAes and CNAes using API Gateway.
  • All external devices (mobile, smart watches, tablets, laptops….) are communicating with the business Process Runtime and any MSA or CNA using the API Gateway.

So now let us try and explore this reference architecture using Google Cloud to see how Google Cloud can help enable those patterns in both Public and Private Clouds.

Sample CNA/MSA Reference Architecture — Google Cloud

In the above blueprint we can see that Google Cloud is offering a set of alternatives for implementing any of the targeted Architecture patterns, let us explore it more :).

Anthos Platform is at the heart of Google Cloud offerings for CNA/MSA and Digital Transformation solutions, Anthos enables hybrid and multi-cloud story, it offers the capability of running, orchestrating & managing workloads distributed across different infrastructure delivering the infrastructure agnostic principle. Anthos also enables governance across such infrastructure so that QoS are not compromised at all, it does that using its Anthos Configuration Management (ACM) and Anthos Service Mesh (ASM).

Through Google Anthos, Kubernetes clusters can be provisioned, monitored and controlled.

In the above blueprint, I chose Google Kubernetes Engine (GKE) as the K8s distribution used in both Private cloud and Google Cloud; but it is flexible you may choose any other distribution.

As for the PaaS hosting CNA & MSA, Google Cloud offers in addition to GKE:

  • Google App Engine which is a fully managed serverless PaaS; it highly supports and enables all CNA design principles and best practices such as 12 factors.
  • Google Cloud Run which is based on Knative and is a PaaS offering to run serverless workloads. It enables EDA pattern and FaaS implemnations.
  • Google Cloud Function, which is a fully managed serverless FaaS offering, the main difference between Google Cloud Functions and Google Cloud Run is that the earlier is constrained with the design principle of a FaaS in the number of code lines, size of the artifact and the length of execution for a function while the latter is much flexible in that manner.

As for the backing services, Google offers most of the Google Cloud services to be provisioned dynamically using the K8s config connectors which facilitate provisioning and managing a service in the Google Cloud and also enables binding it to a workload at the runtime.

Through the config connector you can provision dynamically databases, such as Google Cloud SQL, and Google Cloud Spanner and AI services, such as Google BigQuery in the cloud.

As for API Gateway and API Management, Google Cloud offers APIGee which is a SaaS offering to manage and control access to MSAes/CNAes distributed in multi and Hybrid clouds.

In the DevOps World, Google Cloud offers a set of services, such as Cloud Source Repository, Cloud Build, Stackdriver Monitoring and others. It also supports the hybrid story by having the ability to integrate with a wide scale of DevOps tools and pipeline(s).

Just to complete the story Anthos is fully integrated with APIGee and Google Cloud and enables provisioning GKE and Cloud Run in the Ground to offer the optimum hybrid solution, again more agnostic towards the infrastructure and the platform running the solutions.

To conclude, CNA/MSA solution architecture is a blend of different architecture and design patterns. CNA/MSA & Digital Transformation main goal is to be infrastructure and platform agnostic in another word; it is not anymore about infrastructure and runtime; it is more about quality, agility, flexibility, adaptability, and intelligence. That is why MSA/CNA and Digital Transformation is always in favor of hybrid and multi clouds

--

--

Rania Mohamed
Google Cloud - Community

I am a SA in the SW App area, working at Google. I am fond of CNA, MSA, SOA, App Integration,Java, Design & Architecture. Big dreams towards digitalized world.