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
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Serverless Patterns: Web
  • How to Practically Implement Microservices Infrastructure in Your Business
  • Mainframe Modernization Acceleration Through OpenShift
  • Reactive Microservices - 1

Trending

  • How (and Why) to Build Dynamic Data Pipelines
  • The Cron Job Stopped and Nothing Turned Red
  • AI Didn't Replace Software Engineering; It Changed the Bottleneck
  • Modernizing a Legacy Java Application With OpenRewrite: What We Automated and What We Didn't

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. Data
  4. Fast Prototyping: From Monolith to Microservices

Fast Prototyping: From Monolith to Microservices

Designing a distributed microservice architecture from nothing is tricky; this article shows you how to start with the monolith then divide it into microservices.

By 
Grzegorz Skorupa
·
Jun. 13, 18 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
7.0K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

One of the drawbacks of the microservice concept is that it is difficult to design a distributed microservice architecture right at the start of a project, and mistakes made at this stage can be very expensive. For this reason, the most common advice is to start with the monolith and then divide it into target microservices.

This article presents just such an approach to system prototyping.

As an example, we will use a task management system for a hypothetical support team. The system will be designed first as one application (monolith), and then divided into separate microservices.

To build the application we will use Cricket Microservices Framework, which is one of the lightest frameworks of this type for Java. Cricket is designed and optimized for this approach from the very beginning. This is due to the fact that the application can be easily divided into smaller elements by transferring selected adapters to them.

There will be 3 articles in total:

  1. Fast prototyping: from monolith to microservices (this one)

  2. Fast prototyping: building of the monolith

  3. Fast prototyping: breaking up of the monolith

Overall Concept

An example task management system should have the following features:

User Management

Access to the system functionality should be possible only for logged in users. That is why we will need a module enabling user management and an authentication system.

Task Management

We will implement the basic functionality of the ticketing system, i.e. creating tasks with a name and description and changing the status of the task to "completed."

Knowledge Base

It is worth to make the knowledge base available to users - as articles available after logging into the system.

REST API

All functionalities listed above should be available via the REST API. Thanks to this, it will be possible to create dedicated applications facilitating the use of the system. It can be a web application available through a browser or a dedicated mobile application.

Web Applicatioon

Our system should be available through a web browser, so we will add an element that is a simple web application.

Sending Notifications of New Tasks

Creating a new task should cause sending a notification to all users. We will use for this purpose the API made available by Slack.

Cricket MSF for Fast Prototyping

Main features and architectural elements of the Cricket platform:

  • Hexagonal architecture

  • Microkernel

  • Embeded HTTP server

  • Automatic Java to JSON serialization

  • Events scheduler

  • Events dispatcher

  • User and access management

  • Content management

  • Embeded databases: key-value, H2

Thanks to these features, the prototype building process can be limited to the coding of the task module and web app, while the remaining functionalities will be implemented using ready-made Cricket modules. This will significantly reduce the time it takes to create a prototype, and that is what we are looking for.

Stages of Prototype Building

We will do the prototype development in 3 main steps:

  1. Building a monolithic application

  2. Implementation of the Gateway API pattern

  3. Dividing the application into microservices

The overall architecture of the monolithic application is based on the hexagonal architecture of the Cricket platform. The assumed functionalities are implemented by dedicated adapters.

Image title

The target system will consist of a set of separate microservices, each of which will be responsible for a specific functionality. Since the aim of the article is to show the procedure of prototyping and decomposition of the monolith, and not the very design of microservices, let's arbitrarily accept this set as correct.

Image title


The process of building a monolithic application will be described in the article "Fast Prototyping: Building of the Monolith."

References

https://cricketmsf.org

http://microservices.io/patterns/apigateway.html

microservice mobile app

Published at DZone with permission of Grzegorz Skorupa. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Serverless Patterns: Web
  • How to Practically Implement Microservices Infrastructure in Your Business
  • Mainframe Modernization Acceleration Through OpenShift
  • Reactive Microservices - 1

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

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 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook