DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Software Design and Architecture
  3. Microservices
  4. Microservices Architecture: Challenges of Building Microservices

Microservices Architecture: Challenges of Building Microservices

Building good microservices is tricky business. In this post, we cover some of the challenges in the process and some of the basic ways to conquer them.

Ranga Karanam user avatar by
Ranga Karanam
CORE ·
May. 14, 19 · Analysis
Like (2)
Save
Tweet
Share
7.34K Views

Join the DZone community and get the full member experience.

Join For Free

Microservices architectures are very popular today. In this article, we discuss the important challenges in developing a microservices architecture.

  • Identifying Microservice Boundaries and Implementing Bounded Context
  • Having Proper Configuration Management
  • Implementing Technology for Dynamic Scale Up and Scale Down
  • Ensuring High Visibility
  • Ensuring High Fault Tolerance

Introduction to the Cloud and Microservices: Challenges and Advantages

This is the fourth article in a series of five articles on cloud and microservices. You can find the first three parts here: 

  • Microservices Architecture and a Quick Introduction to Cloud: Why, What, and How 
  • Microservices Architecture: Introduction to Spring Cloud
  • Microservices Architecture: Advantages of Microservices

Identifying Microservice Boundaries: Implementing Bounded Context

We are aware that in a microservices architecture, instead of single, big monolithic application, we build a number of independent microservices talking with each other:

Basic Microservices Architecture

Basic Microservices Architecture

An important question one faces while designing such a system is, 'how do we define the boundaries of individual microservices?'

How do you decide what one service does, and what it should not do?

This is particularly difficult for a new application, as there may not be enough business knowledge to establish the right boundaries.

The task of deciding the boundaries of microservices is an evolving process. It is not something you necessarily get right the first time.

It often involves using domain driven design while playing around with the functionality of the microservices. As you gain design knowledge, you need to put that knowledge back into the microservices architecture.

The best practices include following domain driven design practices.

Having Proper Configuration Management

Configuration management poses quite a stiff challenge in implementing microservices.

Suppose that, in our system, we have a few microservices, each of which has multiple instances in each environment: Microservices Configuration Management

Microservices Configuration

In a slightly larger system, there could be 10 microservices with 5 environments, and 50 instances at least. We are talking about tons of configurations here!

This will involves a lot of work for the operations team, just to maintain all these configurations.

Typically, centralized configuration helps you manage configuration.

Implementing Technology for Dynamic Scale Up And Scale Down

For a microservices architecture, establishing the technology to do dynamic scaling of infrastructure is a mountain to scale in itself.

The loads on different microservices could be different, at different points in time: Microservices Load Balancing

Microservices Load Balancing

At a particular point in time, you may need two instances of Microservice2. However, at a later point in time, that may go up to four. Again, it could shoot up to 10 later. In essence, we need to bring up new instances of a microservices when they are in demand, and bring them down when they are no longer needed.

All this scaling needs to be done with dynamic load balancing. At the point of time shown in the diagram above, the load from Microservice1 needs to be distributed among the four instances of Microservice2. Later, when there are 10 instances of Microservice2, there needs to be another load redistribution among those 10 instances.

Building an architecture for this involves a number of technical components: a naming server, load balancers, and monitoring tools to identify whether to scale in or scale out.

Ensuring High Visibility

Ensuring visibility is one of the most important challenges that needs to be addressed.

Microservices Visibility

Microservices Visibility

If we say that the functionality of the above system needs to be distributed among 10 microservices, but there is a bug, how do you identify where the bug is? There is clearly a need for a centralized log, where we need to find out what happened with a specific request.

We also need to have effective monitoring across the microservices.

Ensuring High Fault Tolerance

If not well designed, a microservices architecture can behave like a pack of cards. A microservice at the end of such a chain would be fundamental to the system behaving well.

Therefore, it is very important for you to have sufficient fault tolerance in place in your system.

Summary

In this article, we looked at the various challenges that need to be addressed while designing a microservices architecture. We covered areas such as bounded context, configuration management, dynamic scale up and scale down, and visibility and fault tolerance.

microservice Architecture

Published at DZone with permission of Ranga Karanam, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How We Solved an OOM Issue in TiDB with GOMEMLIMIT
  • Top 5 Data Streaming Trends for 2023
  • Introduction To OpenSSH
  • Getting a Private SSL Certificate Free of Cost

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: