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

Grzegorz Skorupa user avatar by
Grzegorz Skorupa
·
Jun. 13, 18 · Tutorial
Like (6)
Save
Tweet
Share
5.97K Views

Join the DZone community and get the full member experience.

Join For Free

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.

Popular on DZone

  • Rust vs Go: Which Is Better?
  • Use Golang for Data Processing With Amazon Kinesis and AWS Lambda
  • Fargate vs. Lambda: The Battle of the Future
  • Comparing Map.of() and New HashMap() in Java

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: