Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

The Truth about Microservices

May 4, 2017
Brian Atkisson
Related topics:
Microservices

Share:

    John Frizelle, a Mobile Platform Architect at Red Hat, gave a talk on microservices wherein he provided some great advice about microservices. Most importantly, he provided guidance on when, where, and why (or why not) you should deploy them.

    What are Microservices

    Microservices are a method of breaking down an application into a suite of small, lightweight services, and are processes that typically communicate over HTTP. Building a single microservice is easy, building a microservice architecture is extremely hard. It is basically distributed system design and development. If you are going to embark on a new microservice architecture, here are some challenges you will likely face.

    8 Challenges with Microservices

    Building Microservices

    • How do you identify dependencies between services? A change to one can result in multiple service rebuilds.
    • You must carefully track individual service versions and then determine what versions of what services constitute a release.

    Testing

    • Unit testing is super easy with microservices, by definition.
    • Integration testing requires figuring out what actually needs to be tested, what are its neighbors?
    • End-to-End testing requires standing up the entire microservice architecture with the right versions, but by its nature, these microservices are all versioned independently. It can be difficult to event determine what versions of other microservices you need to test.

    Versioning

    • Each service will have a unique, independent version.
    • The collection of microservices will have a version.
    • Maintaining a version matrix becomes very complex, especially maintaining this over time.
    • How do you release and maintain backward compatibility? Do you maintain the old code and add the new features? This will lead to code bloat, which is contrary to the nature of microservices. Your other option is to release breaking changes, where you have to release multiple dependent versions all at the same time.

    Deploying

    • Deploying microservices requires strong automation, as the system is too complex to deploy by hand. This is a prerequisite to moving to microservices.
    • Blue/Green deployments are a desirable deployment methodology for microservices. The system is too complex to try to back-out changes.

    Logging

    • Microservices require centralized logging, as there is no one place to figure out what is going on. Logging into tens or hundreds of services to tail logs is pretty useless.
    • You will also require some type of global request tracing, assigning a request ID to each request such that you can figure out how things flow.

    Monitoring

    • Microservices should only be deployed along with a centralized dashboard. Monitoring multiple microservices is a very difficult task, you need something to aggregate the service data.
    • Your monitoring solution also requires distributed request tracing. Microservice architectures really require a mechanism to visualize a request ID across the services and measure performance. One slow microservice can slow down the application to a halt.

    Debugging

    • Root cause analysis - how to determine where the problem exists with microservices? It is virtually impossible to tell where the failure is without the monitoring solution. Only then can you begin to isolate the actual problem.
    • Remote debugging is not feasible across many microservices at once. You need to be able to iterate the microservice versions very quickly, sometimes guessing to solve your problem.

    Connectivity

    • Microservice architectures should include a service discovery registry. You don't want to hardcode URLs into your microservices, especially with moving between CI/CD environments. How do they contact each other? How do they contact the right version of each other?
    • Network - there are network hops between each service, these add latency and possibly data loss between each service. Your architecture needs to accommodate failures gracefully. Build in short TTLs, fail quickly to bubble up the failures rather than a slow crawl to death. Failing quickly lets you retry quickly.

    When should you consider moving to microservices?

    Traditional monolithic architectures have their own unique and well-understood challenges. If you are starting to see these block development efforts, microservices might be your answer.

    Size

    • The monolith application code base size has grown too large for local development. Can you even load all the code in your IDE at once?

    Stack

    • Your monolith will be a single technology stack rather than the right stack for the right purpose.
    • The initial large jump from one stack to another is very difficult, subsequent jumps are much easier to make.

    Failure

    • If anything fails in a monolith, everything fails... it is all one system.
    • Much larger surface area to attack and to be exposed to external conditions

    Scaling

    • Only really can scale a monolith vertically, you have to increase everything at the same time. This leads to excessive cost and resource consumption.
    • A few large VMs are usually much more expensive than many small VMs or containers

    Developer Productivity

    • Developers cannot work independently, rather in fewer, and larger teams.
    • In a single code-base, CI takes much longer occurs much less frequently. You typically have to wait for nightly or weekly builds to see if anything breaks.

    If you do decide to move to microservices, you might realize these benefits:

    • Agility and flexibility.
    • Smaller code-base, easier to wrap head around.
    • More, smaller teams rather than one larger team.
    • Easier to scale microservices, only scale the ones that are hot.
    • Right stack for the right job, you are no longer bound to one stack.

    If you are going to run microservices, understand why and what benefits you will receive. Start out from day one with automation. Trying to add it later will ultimately make your effort fail, you need to invest in the automation before starting to build.

    Finally, remember Conway's law - moving to microservices will likely require an "Agile Transformation". Your organization should mirror the microservice architecture.


    For a framework for building enterprise Java microservices visit WildFly Swarm and download the cheat sheet.


    Join Red Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!

    Last updated: February 20, 2018

    Recent Posts

    • How Trilio secures OpenShift virtual machines and containers

    • How to implement observability with Node.js and Llama Stack

    • How to encrypt RHEL images for Azure confidential VMs

    • How to manage RHEL virtual machines with Podman Desktop

    • Speech-to-text with Whisper and Red Hat AI Inference Server

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue