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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

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
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

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Single Responsibility Principle: The Most Important Rule in the Software World
  • Common Performance Management Mistakes
  • Data Fabric: What Is It and Why Do You Need It?
  • Transitioning from Monolith to Microservices

Trending

  • Rust and WebAssembly: Unlocking High-Performance Web Apps
  • Debugging Core Dump Files on Linux - A Detailed Guide
  • Automatic Code Transformation With OpenRewrite
  • How to Convert XLS to XLSX in Java
  1. DZone
  2. Data Engineering
  3. Databases
  4. Diving Into Reactive Microservices

Diving Into Reactive Microservices

What happens when reactive meets microservices?

By 
Mansi Babbar user avatar
Mansi Babbar
·
Jun. 22, 20 · Opinion
Likes (14)
Comment
Save
Tweet
Share
15.3K Views

Join the DZone community and get the full member experience.

Join For Free

It would be beneficial if you understand the concepts of Reactive Architecture before diving into Reactive Microservices.

In this article, we will cover transition from Monoliths to Service Oriented Architecture to Reactive Microservices by applying isolation techniques to the application.

Architecture comparison

What Are Monoliths?

To start explaining the microservices it’s useful to compare it to the monolithic application. An application is said to be a monolith when it is deployed as a single unit. Monoliths have a single shared database. They communicate with synchronous method calls where you send a message and expect a response immediately.

What Are the Cons of Monoliths?

  • Monoliths are limited by the maximum size of a single physical machine. As the monolith grows, it acquires more and more system resources.
  • They scale as far as the database allows because they often rely on a relational database which probably runs only a single instance in order to maintain consistency.
  • Monolith components have to be scaled as a group, even if certain components of the application may require less resources.
  • The deep coupling in monoliths leads to inflexibility, due to which development is typically slow.
  • Serious failures in one component often bring down the whole monolith due to cascading failures. 

What Is Service-Oriented Architecture?

Service-oriented Architecture is an architectural style that structures an application as a collection of smaller independent services. These microservices can be physically separated and independently deployed and scaled. Each microservice has its own logic and database as well as performs specific function. Communication between microservices can be synchronous or asynchronous, also the communication between these services is done through APIs only. Microservices undergo rapid deployments, it's not uncommon to see them getting deployed once a day or even multiple times a day.

What Are the Pros of Service-Oriented Architecture?

  • Due to isolation and loose coupling between microservices, any change to the internals of one microservice does not necessitate a change to another microservice. Also, serious failure in one microservice does not cause cascading failures to other microservices.
  • Since these services are accessible through external APIs only, so you're free to evolve the underlying code.
  • Microservices also support multiple platforms and languages. It's very easy to build your application in any programming language and using any database. 

What Are Reactive Microservices?

The core of Reactive Microservices is finding ways to create more isolation between microservices. Reactive microservices follow principles of isolation using various isolation techniques. 

What Are the Principles of Isolation?

As we move from monoliths to microservices, more isolation is being introduced. Isolation provides reduced coupling and increased scalability.

Reactive Microservices are isolated in: State, Space, Time and Failure

Isolation of State

Reactive microservices are accessible through its API only, no backdoor access is provided through the database. It allows microservices to evolve internally without affecting outside.

Isolation in Space

Reactive microservices are independently deployed and do not care about the location of other microservices. The location of a microservice can be changed during deployment without an impact on other microservices. It allows microservices to be scaled up/down to meet demand.

Isolation in Time

Reactive microservices are asynchronous and non-blocking, due to which it leads to more efficient use of resources. Between microservices we expect eventual consistency, which provides increased scalability.

Isolation of Failure

Reactive microservices also isolate failures. A failure in one microservice does not cause another to fail. It allows the system to remain operational in spite of failure.

What Are the Isolation Techniques?

Bulkheading

Bulkheading is a technique in which failure zones are created in the application to isolate failures, so that failure in one microservice is not propagated to other microservices and the overall system remains operational(possibly in a degraded state).

Circuit Breaker

Circuit breaker is another technique to isolate failures. When a microservice calls another microservice which is overloaded and may fail. The caller microservice may not realize that the called microservice is under heavy load and it may retry, resulting more load on the called microservice. Caller microservice needs to be careful to avoid this. Circuit breakers are a way to avoid overloading a service by quarantining the failing service so it can fail fast and allowing the service to recover without overloading it.

Message Driven Architecture

Reactive microservices follow message driven architecture. They use asynchronous non-blocking messaging which allows isolation in both time and failure. It means that if a request to a microservice fails, the failure won’t propagate. Also microservices are not dependent on the response from each other, the client service can continue to operate without waiting for the response.

Autonomous Microservice

Reactive microservices are autonomous in nature, they can only guarantee their own behaviour through API calls. Isolation of microservices allow them to operate independent of each other. Autonomous microservices have enough information to resolve conflicts and repair failures. Fully autonomous service having no external dependencies, can be scaled indefinitely. Autonomy allows for stronger scalability and availability. Autonomy can be achieved using eventual consistency and by communicating only through asynchronous messaging.

API Gateway Service

Microservices can lead to complexities in the API. A single request may require information from multiple microservices. Clients could send multiple requests but then aggregating these results will be complex. To manage this complexity, API gateway service can be introduced to send requests to individual microservices and aggregate the response. Aggregation logic is moved from client to API gateway service. It handles failures from each service and client has to deal with only gateway service failure.

microservice Isolation (database systems) application Database Service-oriented architecture Architecture Relational database

Opinions expressed by DZone contributors are their own.

Related

  • Single Responsibility Principle: The Most Important Rule in the Software World
  • Common Performance Management Mistakes
  • Data Fabric: What Is It and Why Do You Need It?
  • Transitioning from Monolith to Microservices

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!