Converting from Monolith to Microservice Architecture

Converting from Monolith to Microservice Architecture

Monolith applications may suffer from multiple problems and issues that can be resolved using microservices architecture.

We will use a domain driven design (DDD) approach to decide and convert our monolith to a scalable microservice architecture.

Not all applications fit as a candidate for microservice architecture; as small applications with few subdomains are better maintained as a monolith.

The decision to move from a monolith to microservices can be guided by the following questions:

  • Do we have more than a few subdomain models (few is between three and nine) in our monolith application?
  • Can we afford the extra overhead of multiple database schemes and service bus?
  • Are we expecting our subdomains to expand in the near future?

If our answers slide to the "yes" side more than that to the "no"; then we can start thinking of converting our application from a monolith to a microservice architecture.

The Business Administration Example Application

To better understand the process and the concepts, let us adopt a real lifetime example.

Let us say that we have a monolith business administration application that consists of three subdomain models: Reception, Backoffice, and Management as illustrated in the following diagram:

As you can see, there are three subdomain models in this application, this is meant for simplicity of the example. Usually, if your application is small and consists of only few models you may prefer keeping it maintained as a monolith rather than splitting it to a set of microservices in sake of cost efficiency of RDBMS systems and not to have to use extra components needed for the architecture.

Our example application has three models serving different actors' business requirements and is utilizing a single database.

Characteristics of Microservice Architecture Application

Take a look at the following diagram where we split the monolith application into an equivalent microservice architecture pattern:


All what we did is that we split the application into three microservices each serves a specific subdomain.

Notice that now each microservice has its own database, a thing that might add extra cost of RDBMS licenses as well as extra overhead of maintenance.

Also notice that data records might now get duplicated between those microservices schemes as no one service is allowed to access the database of another.

But how do the three microservices communicate to establish a concrete business workflow?

The Service Bus

Take a look on the following diagram:

Here we added a service bus such as Kafka, Artemis MQ, or RabbitMQ. This is to serve as an interprocess communication mechanism allowing microservices to log events with data needed by other microservices to update and maintain there persistent status.

This pattern serves scalability very well, as now we can add as many services as we need and provide proper communication using event logs.

The Deployment View

Now as we succeeded converting our monolith to microservice architecture, the remaining question is how we deploy them. Take a look on the following deployment diagram that offers scalability at its maximum levels.

To know the details watch my video on you tube: https://www.youtube.com/watch?v=AvxtzkQUxE0


要查看或添加评论,请登录

Mahmoud Zamel的更多文章

  • Determining Customer Story Complexity

    Determining Customer Story Complexity

    As we are using customer stories as an indicator of team productivity, we figure out that each story contribution is…

  • Customer Stories Factor in Productivity Measurements

    Customer Stories Factor in Productivity Measurements

    Customer stories can be used as a metric to measure software team productivity. When a sprint starts with planning…

  • Measuring Software Team Productivity

    Measuring Software Team Productivity

    Productivity of a software development team is a bit tricky to measure without falling int one or more fallacy beliefs.…

    1 条评论
  • Playing Multiple Roles During Project Execution

    Playing Multiple Roles During Project Execution

    In the far past I had the chance to play multiple roles during execution of an undertaken project. I did that in so…

    2 条评论
  • Planning vs. Procrastination

    Planning vs. Procrastination

    Should you plan your daily activities? Should you plan your month, your year, and your life? Planning is a crucial…

  • Scaling PostgreSQL Database

    Scaling PostgreSQL Database

    Database scalability is one of the most crucial aspects of software solutions design and development, as well as the…

  • The Journey from Business Requirements to Production Code

    The Journey from Business Requirements to Production Code

    I am an advocate of using agile processes to tackle undertaken projects to implement custom code solutions. But agile…

  • The Software Bug Nightmare - September of 2001

    The Software Bug Nightmare - September of 2001

    The first recorded instance of a bug causing a technical malfunction occurred in 1947 when engineers working on the…

  • The Gift of Fast Failing

    The Gift of Fast Failing

    We fail more times than those we do succeed! Failing fast is a gift given to those who know the value of failing fast…

  • Colors and Shapes Matching in Technical Drawings

    Colors and Shapes Matching in Technical Drawings

    I am an artist even when it comes to producing a technical drawing. Like painters and graphics designers do with wall…

社区洞察

其他会员也浏览了