The Wayback Machine - https://web.archive.org/web/20171222031914/http://soa.sys-con.com/node/4177673

Welcome!

Microservices Expo Authors: Derek Weeks, Elizabeth White, Liz McMillan, Jason Bloomberg, Stackify Blog

Related Topics: Java IoT, Microservices Expo, @CloudExpo, @DevOpsSummit

Java IoT: Article

Reference Architecture #Microservices | @CloudExpo #Serverless #AI #DevOps

The goal of microservices is to improve software delivery speed and increase system safety as scale increases

The goal of Microservices is to improve software delivery speed and increase system safety as scale increases. Microservices being modular these are faster to change and enables an evolutionary architecture where systems can change, as the business needs change. Microservices can scale elastically and by being service oriented can enable APIs natively. Microservices also reduce implementation and release cycle time and enables continuous delivery. This paper provides a logical overview of the Microservices Reference Architecture that highlights various sub systems needed to support Microservices deployment and execution.

Introduction
Switch over to Microservices is an hour of need in web application development and delivery and is crucial for the success of Enterprises today.

Of late, enterprises are adopting technologies like analytics, mobility, social media, IoT and smart embedded devices to change customer relationships, internal processes and value propositions. Microservices acts like a bridge between these technologies and provides the building blocks for developing modern distributed enterprise systems to become one of the enablers in the digital transformation journey of the enterprise.

Adoption of Microservices provides the agility, reliability, maintainability, scalability and deploy ability to the enterprises as part of digital transformation process.

There exists many different architecture definition approaches for implementing Microservices across Industry. Many of them are unique and specific to the needs of individual development teams. Many enterprises, without understanding or highlighting the name, have been using an approach towards leveraging APIs that classified as Microservices. This demands a need for designing Reference Architecture to develop and deliver Microservices‑based applications that consumed across the Enterprises.

There exists, numerous articles and blogs on Microservices reference architecture, architecture principles and best practices. This paper summarizes the purpose of Microservices Reference Architecture, drivers for adopting Microservices, Microservices architecture principles and logical view of Microservices Reference Architecture.

Drivers for Microservice Reference Architecture
Microservices are smaller in scope, determined by a focus on domain boundaries and consistent domain modelling, and require less code. In addition, in Monolithic applications, the application components communicate in memory. In the case of Microservices based applications, the communication happens over the network. This leads to software development and deployment becomes more reliable and faster.

With Microservices, each service can scale independently to meet temporary traffic, complete batch processing and other business needs. Improved fault isolation restricts service issues, such as memory leaks or open database connections. The scalability of Microservices complements the flexibility of cloud services improves service and handle more customers simultaneously without interrupting service.

The following diagram represents few key drivers for Enterprises adopting Microservices.

Microservices Architecture Principles
Below are few key architectural principles for Microservices:

Single Responsibility Principle: Each microservice must be responsible for a specific feature or a business functionality or aggregation of cohesive functionality completely.

Granular: Microservice granularity is contained within the intersection of a single functional domain, a single data domain and its immediate dependencies, a self-sufficient packaging and a technology domain.

Domain Driven Design: Domain driven design is an architectural principle in-line with object-oriented approach. It considers the business domain, elements and behaviors and interactions between business domains.

Encapsulation: Each Microservice encapsulates the internal implementation details, so that the external system utilizes the services need not worry about the internals. Encapsulation reduces the complexity and enhances the flexibility of the system.

Loose Coupling: There must be zero coordination necessary for the deployment with other Microservices. The changes in one microsystem should have zero or minimum impact on other services in the eco-system.  

Separation of Concerns: Develop the microservices based on distinct features with zero overlap with other functions. The main objective is to reduce the interaction between services so that they are highly cohesive and loosely coupled. If we separate, the functionality across wrong boundaries will lead tight coupling and increased complexity between services.

Language Neutral: Microservices are composed together to form a complex application, and they do not need to be written using the same programming language. For example, Java might be the correct language for one application, and in others, it might be Python etc.

Hexagonal Architecture: Microservice exposes RESTful APIs for external communication, message broker interface for event notification and database adapters for persistence. This makes hexagonal architecture as a most suitable style for Microservice development.

Sizing of Microservices
It is important that, while designing a Microservice, there is a need to decide on the number and size of individual Microservices. There is no strict rule regarding the optimal size of the Microservice and it depends on the partitioning of the problem space if it is a new development application or splitting the existing monolithic application into individual Microservices.

Also, Microservices cannot be too large or too small. Large services are hard to work with, hard to deploy, and take longer to start and stop. On the other side, when Microservices are too small, the resource cost of deploying and operating such a service overshadows its utility.

Microservice granularity can also be determined based on business needs. Making services too granular, or requiring too many dependencies on other Microservices, can introduce latency.

Microservices allow teams to plan, develop, and deploy features of a system in the cloud without tight coordination. It is therefore, Microservice number and size be dictated by business and technical principles.

Microservices Reference Architecture
Microservices is an architecture style, in which software systems or applications are composed of one or more independent and self-contained services. It is not a product, framework, or platform. It is a strategy for building large distributed systems and are loosely coupled and deployed independently of one another.

The following guidelines to be adapted while designing the services of Microservices Reference Architecture.

  • Lightweight: To facilitate smaller memory footprints and faster start up times
  • Reactive: Applicable for services with concurrent loads or longer response times
  • Stateless: Services scale better and start faster as there is no state to be passivated on shutdown or activated on start up
  • Atomic: helps to do the smallest business unit of work that can be done independently
  • Externalized Configuration: externalize the configurations in the config server, so that it can be maintained in hierarchical structure per environment
  • Consistent: Services should be written in a consistent style as per the coding standards and naming convention guidelines
  • Resilient: Service should handle exceptions arising from technical reasons (connectivity, runtime), and business reasons (invalid inputs) and not crash
  • Reporting: Usage statistics, number of times accessed, average response time, etc. via JMX API
  • Versioned: Support multiple versions for different clients, till all clients migrate to higher versions

Below is the logical view of the Microservices reference architecture.

Fig 2: Microservices Reference Architecture - Logical View

Various components of the reference architecture are described below:

Channels: Channels represents various client side or consumer applications, which will interact with Microservices.

Edge Server: API services or edge services reside on edge server or the API Gateway. Channels interact with the edge services, which decouples the microservices, and keep them channel agnostic.

API gateway is the single entry point for all clients. API Gateway is responsible for aggregating data or, in some cases, acting as a simple routing layer for appropriate services. The API gateway act as a single point of failure. For the coordination between cloud and on premise communication, an API Gateway is used.

The following diagram shows the API gateway interaction patterns

Load Balancer
It is a software based load balancer used for communication between Microservices. Configured for each service for availability, scalability and reliability.

Below diagram show load-balancing scheme.

Decentralized load balancing is the appropriate mechanism for distributing requests between available Microservice instances. Each Microservice can have its own load balancer handling only requests for that Microservice. Client is directly responsible for routing requests to an available Microservice.

API Service: API services need to be exposed either on the edge server or on API Gateway. The Service expose client specific API and can also act as coarse-grained services to orchestrate across multiple Microservices within or across bounded contexts. These services can interact with composite Microservices or directly with core Micro services.

API services can also communicate with the Enterprise Integration Infrastructure (typically ESB/MOM) to access any on premise Enterprise Applications

Composite Service: Composite services orchestrate across multiple core services. These services shall be communicating with the other services using the event-sourcing model or orchestration.

Core services: These services are the basic building blocks for Microservices architecture. These services encapsulate an entity or an aggregate (fine grained) within a given bounded context. Best practice is that, the granularity of the Microservices are always fine grained.

Circuit Breaker: Fault tolerance will ensure that when there is failure, the failed services does not adversely affect the entire system. Without proper mechanisms in place, errors, latencies will trickle up to the calling clients where they will potentially exhaust limited resources. When cascading failures occur, the overall system availability is significantly affected.

The three states of the Circuit Breaker is depicted below,

Closed State
When the service dependency is healthy and no issues detected, the Circuit Breaker is in state of closed. All invocations can pass through the service.

Open State
Circuit Breaker considers the following invocations as failed and factors them in deciding circuit open:

  • Request to the remote service time out
  • Thread pool and bounded task queue used to interact with Service dependency are at 100% capacity
  • Client library used to interact with a service dependency throws an exception

In open state, the circuit breaker reject invocations by either

  • Throwing an exception
  • Returning a fallback output

Half Open State
When the circuit breaker is in Open state, it periodically leaves through one invocation at a configurable interval. If the invocation succeeds, the circuit is closed again.

Cloud Config: It is a single source of configuration data for all other services in a Microservice-based application. Each service can have its configuration in a repository, which centralizes the configuration across all environments. It decouples the configuration from the implementation, which helps to update the configuration without affecting any of the services. Every update on the configuration files in the repository are automatically propagated to the running instances.

Service Discovery: In Microservices application, the dynamic assignment of service instances network locations happens automatically. In addition, the set of service instances changes dynamically because of auto-scaling, failures and upgrades. Consequently, the client code needs to use a service discovery mechanism.

There are two main service discovery patterns: Client-side discovery and Server-side discovery.

  • Client-Side Discovery Pattern: Client is responsible for determining the network locations of available service instances and load balancing requests across them. The client queries a service registry, which is a database of available service instances. The client then uses a load-balancing algorithm to select one of the available service instances and makes a request.
  • Server-Side Discovery Pattern: Client makes the request to a service via a load balancer. The load balancer queries the service registry and routes each request to an available service instance.
  • Service Registry: Service registry is a key part of service discovery. It is a database containing the network locations of service instances. A service registry needs to be highly available and up to date. Clients can cache network locations obtained from the service registry. However, that information eventually becomes out of date and clients become unable to discover service instances.
  • Self-Registration Pattern: Service instance is responsible for registering and deregistering itself with the service registry. In addition, a service instance sends heartbeat requests to prevent its registration from expiring.
  • Third-Party Registration Pattern: In this case, another system component known as the service registrar handles the registration. The service registrar tracks changes to the set of running instances by either polling the deployment environment or subscribing to events. It registers and deregisters the service instances.

Messaging & Events Stream: Lightweight messaging platforms like AMQP shall be used for exchange of messages between microservice within or across bounded contexts or in case of event sourcing used as part of the choreography.

Monitoring: As microservices are distributed and heterogeneous in nature, it is critical to monitor and visualize making sure that software is reliable, available, and performs as expected. Monitoring typically involves collecting metrics from all the applicable systems involved and analyzing/visualizing call graphs. These gets complex as the application complexity (again depends on number microservices and their interactions in a call graph) grows. There are many commercial and open source tools for monitoring microservices.

Distributed Tracing: Distributed tracing helps in how a request traverse through the application, especially when you may not have any insight into the implementation of the microservice you are calling. Tracing tools introduces unique IDs for logging which are consistent between Microservice calls which makes possible to find how a single request travels from one Microservice to the next.

Security: With microservices, security becomes a challenge primarily because no middleware component handles security-based functionality. Instead, each service must handle security on its own, or in some cases, the API layer be made more intelligent to handle the security aspects of the application. Security Frameworks like oAuth2 address the security concern. There are multiple ways of configuring security for microservices; by making API Gateway behave like reverse proxy or by securing each microservice using the security service (backing service like IAM) provided by the PaaS provider.

Backing Services: A PaaS provides services grouped into various categories like database, analytics, security, Data warehouse etc. used by the cloud application. These services expose lightweight protocols (like REST) and consumed by the cloud application by binding. PaaS providers provide consoles (UI based) to manage backing services.

On Premise Integration: API Gateway helps to mediate the communication between cloud and on premise applications. API Services will be used to orchestrate calls that span cloud and on premise by calling the enterprise integration infrastructure for calling any applications on premise.

Infrastructure: Infrastructure has two components; PaaS and IaaS. IaaS is the abstraction onto the hardware and provides on demand resource provisioning. Resources can be scaled out or in based on usage pattern. PaaS is cloud platform residing on top of IaaS. This layer provide the required support for the cloud applications to deploy and run. PaaS provides various runtimes and many backing services required for a cloud application.

Conclusions
Microservices is not a product, framework, or platform. It is a strategy for building large enterprise distributed systems. One of the characteristic of microservice is of loosely coupled and deployed independently of one another. Microservices architecture can offer enterprises many advantages, from independent scalability of diverse application components to faster, easier software development and maintenance. Sizing of the Microservices is very critical for the design of the better services. Open source technology solutions and organizational methods are leading the Microservices market. As a result, Microservices reduce vendor lock-in and eliminate long-term technology commitment, helps to choose the tools need to meet IT and business goals.

In addition, Microservices Reference Architecture need to be developed based on industry‑standard components like Docker containers, and a wide range of languages - Java, PHP, Python, Node.js/JavaScript and Ruby etc. Developed Microservice must expose JavaScript Object Notation (JSON) or Extensible Mark up Language (XML) over the HTTP to provide a REST API. These standards would provide guidelines about how to describe, maintain, and retire Microservices.

Finally, Microservices based System Design is an ongoing story. It is not something that has to done once, and immediately. With the right people, processes, and tools, Microservices can deliver faster development and deployment, easier maintenance, improved scalability, and freedom from long-term technology commitment.

References

  1. "Microservices". martinfowler.com. Retrieved 2017-02-06
  2. S. Newman, Building Microservices - Designing Fine-Grained Systems, O'Reilly, 2015
  3. E. Wolff, Microservices: Flexible Software Architecture, Addison-Wesley, 2016

Acknowledgements

The authors would like to thank Hari Kishan Burle, Raju Alluri of Global Enterprise Architecture

Group of Wipro Technologies for giving the required time and support in many ways in bringing

Up the article as part of Global Enterprise Architecture Practice efforts.

Authors

Dr. Gopala Krishna Behara is a Lead Enterprise Architect in the SCA Practice division of Wipro. He has a total of 21 years of IT experience. Reached at [email protected]

Tirumala Khandrika is a Senior Architect in the SCA Practice division of Wipro. He has a total of 16 years of IT experience. Reached at [email protected]

Sridhar Chalasani is an Architect in the SCA Practice division of Wipro. He has a total of 12 years of IT experience. Reached at [email protected]

Disclaimer

The views expressed in this article/presentation are that of authors and Wipro does not subscribe to the substance, veracity or truthfulness of the said opinion

More Stories By Gopala Krishna Behara

Dr. Gopala Krishna Behara is a Senior Enterprise Architect in the Enterprise Architecture & Solutions division of Wipro. He has a total of 16 years of IT experience. He can be reached at [email protected]

More Stories By Sridhar Chalasani

Sridhar Chalasani is an Architect in the Global Enterprise Architecture Practice division of Wipro. He has a total of 12 years of IT experience. He can be reached at [email protected]

More Stories By Tirumala Khandrika

Tirumala Khandrika is a Senior Architect in the Global Enterprise Architecture Practice division of Wipro. He has a total of 16 years of IT experience. He can be reached at [email protected]

@MicroservicesExpo Stories
Some people are directors, managers, and administrators. Others are disrupters. Eddie Webb (@edwardawebb) is an IT Disrupter for Software Development Platforms at Liberty Mutual and was a presenter at the 2016 All Day DevOps conference. His talk, Organically DevOps: Building Quality and Security into the Software Supply Chain at Liberty Mutual, looked at Liberty Mutual's transformation to Continuous Integration, Continuous Delivery, and DevOps. For a large, heavily regulated industry, this task ...
"Grape Up leverages Cloud Native technologies and helps companies build software using microservices, and work the DevOps agile way. We've been doing digital innovation for the last 12 years," explained Daniel Heckman, of Grape Up in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
DevOps is under attack because developers don’t want to mess with infrastructure. They will happily own their code into production, but want to use platforms instead of raw automation. That’s changing the landscape that we understand as DevOps with both architecture concepts (CloudNative) and process redefinition (SRE). Rob Hirschfeld’s recent work in Kubernetes operations has led to the conclusion that containers and related platforms have changed the way we should be thinking about DevOps and...
Following a tradition dating back to 2002 at ZapThink and continuing at Intellyx since 2014, it’s time for Intellyx’s annual predictions for the coming year. If you’re a long-time fan, you know we have a twist to the typical annual prediction post: we actually critique our predictions from the previous year. To make things even more interesting, Charlie and I switch off, judging the other’s predictions. And now that he’s been with Intellyx for more than a year, this Cortex represents my first ...
Let's do a visualization exercise. Imagine it's December 31, 2018, and you're ringing in the New Year with your friends and family. You think back on everything that you accomplished in the last year: your company's revenue is through the roof thanks to the success of your product, and you were promoted to Lead Developer. 2019 is poised to be an even bigger year for your company because you have the tools and insight to scale as quickly as demand requires. You're a happy human, and it's not just...
"Opsani helps the enterprise adopt containers, help them move their infrastructure into this modern world of DevOps, accelerate the delivery of new features into production, and really get them going on the container path," explained Ross Schibler, CEO of Opsani, and Peter Nickolov, CTO of Opsani, in this SYS-CON.tv interview at DevOps Summit at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Defining the term ‘monitoring’ is a difficult task considering the performance space has evolved significantly over the years. Lately, there has been a shift in the monitoring world, sparking a healthy debate regarding the definition and purpose of monitoring, through which a new term has emerged: observability. Some of that debate can be found in blogs by Charity Majors and Cindy Sridharan.
How is DevOps going within your organization? If you need some help measuring just how well it is going, we have prepared a list of some key DevOps metrics to track. These metrics can help you understand how your team is doing over time. The word DevOps means different things to different people. Some say it a culture and every vendor in the industry claims that their tools help with DevOps. Depending on how you define DevOps, some of these metrics may matter more or less to you and your team.
DevOps failure is a touchy subject with some, because DevOps is typically perceived as a way to avoid failure. As a result, when you fail in a DevOps practice, the situation can seem almost hopeless. However, just as a fail-fast business approach, or the “fail and adjust sooner” methodology of Agile often proves, DevOps failures are actually a step in the right direction. They’re the first step toward learning from failures and turning your DevOps practice into one that will lead you toward even...
Enterprises are adopting Kubernetes to accelerate the development and the delivery of cloud-native applications. However, sharing a Kubernetes cluster between members of the same team can be challenging. And, sharing clusters across multiple teams is even harder. Kubernetes offers several constructs to help implement segmentation and isolation. However, these primitives can be complex to understand and apply. As a result, it’s becoming common for enterprises to end up with several clusters. Thi...
The Toyota Production System, a world-renowned production system is based on the "complete elimination of all waste". The "Toyota Way", grounded on continuous improvement dates to the 1860s. The methodology is widely proven to be successful yet there are still industries within and tangential to manufacturing struggling to adopt its core principles: Jidoka: a process should stop when an issue is identified prevents releasing defective products
We seem to run this cycle with every new technology that comes along. A good idea with practical applications is born, then both marketers and over-excited users start to declare it is the solution for all or our problems. Compliments of Gartner, we know it generally as “The Hype Cycle”, but each iteration is a little different. 2018’s flavor will be serverless computing, and by 2018, I mean starting now, but going most of next year, you’ll be sick of it. We are already seeing people write such...
The next XaaS is CICDaaS. Why? Because CICD saves developers a huge amount of time. CD is an especially great option for projects that require multiple and frequent contributions to be integrated. But… securing CICD best practices is an emerging, essential, yet little understood practice for DevOps teams and their Cloud Service Providers. The only way to get CICD to work in a highly secure environment takes collaboration, patience and persistence. Building CICD in the cloud requires rigorous ar...
The goal of Microservices is to improve software delivery speed and increase system safety as scale increases. Microservices being modular these are faster to change and enables an evolutionary architecture where systems can change, as the business needs change. Microservices can scale elastically and by being service oriented can enable APIs natively. Microservices also reduce implementation and release cycle time and enables continuous delivery. This paper provides a logical overview of the Mi...
The enterprise data storage marketplace is poised to become a battlefield. No longer the quiet backwater of cloud computing services, the focus of this global transition is now going from compute to storage. An overview of recent storage market history is needed to understand why this transition is important. Before 2007 and the birth of the cloud computing market we are witnessing today, the on-premise model hosted in large local data centers dominated enterprise storage. Key marketplace play...
For many of us laboring in the fields of digital transformation, 2017 was a year of high-intensity work and high-reward achievement. So we’re looking forward to a little breather over the end-of-year holiday season. But we’re going to have to get right back on the Continuous Delivery bullet train in 2018. Markets move too fast and customer expectations elevate too precipitously for businesses to rest on their laurels. Here’s a DevOps “to-do list” for 2018 that should be priorities for anyone w...
It’s “time to move on from DevOps and continuous delivery.” This was the provocative title of a recent article in ZDNet, in which Kelsey Hightower, staff developer advocate at Google Cloud Platform, suggested that “software shops should have put these concepts into action years ago.” Reading articles like this or listening to talks at most DevOps conferences might make you think that we’re entering a post-DevOps world. But vast numbers of organizations still struggle to start and drive transfo...
The cloud revolution in enterprises has very clearly crossed the phase of proof-of-concepts into a truly mainstream adoption. One of most popular enterprise-wide initiatives currently going on are “cloud migration” programs of some kind or another. Finding business value for these programs is not hard to fathom – they include hyperelasticity in infrastructure consumption, subscription based models, and agility derived from rapid speed of deployment of applications. These factors will continue to...
While walking around the office I happened upon a relatively new employee dragging emails from his inbox into folders. I asked why and was told, “I’m just answering emails and getting stuff off my desk.” An empty inbox may be emotionally satisfying to look at, but in practice, you should never do it. Here’s why. I recently wrote a piece arguing that from a mathematical perspective, Messy Desks Are Perfectly Optimized. While it validated the genius of my friends with messy desks, it also gener...
Cavirin Systems has just announced C2, a SaaS offering designed to bring continuous security assessment and remediation to hybrid environments, containers, and data centers. Cavirin C2 is deployed within Amazon Web Services (AWS) and features a flexible licensing model for easy scalability and clear pay-as-you-go pricing. Although native to AWS, it also supports assessment and remediation of virtual or container instances within Microsoft Azure, Google Cloud Platform (GCP), or on-premise. By dr...