Photo by Patrick Fore on Unsplash

“To every problem, there is a most simple solution.” — Agatha Christie

Microservice architecture is a lifesaver for the big companies with complex architectures with complex systems which helps to move a more modular approach by making the codebase into smaller parts and also scalable on-demand saving cost and easily replaceable by new features. But even though it is resilient architecture, to get the full benefits of what microservice has to offer the proper practices should be followed in the software development life cycle and always trying to rely on proven solutions without inventing the wheel and using the solutions…

Photo by Prateek Srivastava on Unsplash

As we discussed on Microservice architecture services should be independent and do not depend on any other services or one service’s functionality must not affect other services. But also when it comes to a scenario like new feature adding, updating, bug fixing one service must not halt other or one service’s development must not be limited by other services. But what happens when a new update of a certain service will affect the other services which are getting service from the updated services and how to avoid breaking down the system? …

Photo by Troy Bridges on Unsplash

In the previous article, we discussed the aggregation patterns used in a microservice architecture. Now the number of services is getting increasing now the team has to put effort on maintaining the services too.

There are situations where services go offline or to a state where that they cannot respond to the responses, it is getting. This can happen due to few scenarios first thing is the excessive load of requests that the service getting. When the requests are getting increasing they had to wait in the queue till they processed this takes latency and then eventually even causes downtime.

Photo by Alex Vasey on Unsplash

“Art is the imposing of a pattern on experience.” — Alfred North Whitehead

After the previous article about Microservice Architecture. it is important to know to create scalable, maintainable services it is important to choose a design pattern based on the scenario.

Aggregator Pattern

When dealing with the Microservices to process a single request or complete a single functionality there might be a need for data from another service because each service has its own database or even consume the data through a service API.

If the developer chooses to retrieve data back from the service, process them, and then return there…

Photo by Tri Eptaroka Mardiana on Unsplash

“Great things are not done by impulse, but by a series of small things brought together.” ― Vincent Van Gogh

Back to the Past

In the old days after developing an application, a separate team will configure a separate machine, routers, switches and putting them into the racks, and taking the application and install. This is sometimes a manual and a long set of processed and dedicated hardware needed to be installed in a server farm. and mostly at one server used for one application which sometimes causes wastage of resources. …

Photo by Vincent Camacho on Unsplash

“Simplicity is the soul of Efficiency.”― Austin Freeman

Microservice came into the dev world after 2000, where some internet giants like Netflix, Amazon, Google are getting bigger and bigger to serve people all around the world. Every company running on software platforms and based on software platforms that start growing the time as company-wise it should widen its capabilities to a larger client base, various sets of features, and scalability for larger geographical zones.

Now let’s look at the time where the application was built in the older days all the components in the software are integrated with the codebase…

Image from Pinterest

Little Bit of History

JavaScript is a scripting language created by Brenden Eich while he is working on Netscape to work with their flagship browser “Netscape Navigator”. First, it was named “Mocha” and then “LiveScript” and then later changed to JavaScript because at that time Netscape is working with Sun Microsystems to find a solution to break the monopoly of Internet Explorer dominance in the internet browsers market and work in web browsers compatible with Java. But Java != JavaScript.

JavaScript basically designed as a core language for creating websites alongside HTML and CSS on the client-side and JS provides the interactivity and the…

Photo by Paule Knete on Unsplash

“You can’t undo the past… but you can certainly not repeat it.” — Bruce Willis

What is Memento Design Pattern?

When dealing with software applications sometimes it is necessary to do the undo and redo or reverse back a process. This is a type of change of state. if we think this from an OOP approach what the Memento Design Pattern does is that externalize an object’s state into another object and change it accordingly to the previous state or existed state.

There are few main objects when dealing with Memento Design Pattern.

Originator - These classes' state needs to tracked and saved for later…

Photo by JJ Ying on Unsplash

What is Chain of Responsibility Design Pattern

When implementing a set of functions the functions need to divide into smaller elements to reduce complexity and increase maintainability. But with the complexity of the problem, the tight coupling can result as a solution for this Behavior Design Patterns introduced to divide the functionalities among the modules effectively, and the Chain of Responsibility Pattern is one of them.

On a very basic level what the chain of responsibility pattern does is that its chain of objects handling user requests. for handling these requests this pattern uses a set of objects called “handlers”. …

Photo by Mika Baumeister on Unsplash

What is Builder Design Pattern

During the object, creation depending on the availability of the variables, and depending on the situation the state of the object has to be changed and the way create is different.

To get the work done developers can set the absent variables into their defaults or null value. or can have multiple constructors. or can use telescopic constructors as below.

//Telescopic Constructors
public PremiumUser(String firstName, String lastName){
this.firstName = firstName;
this.lastName = lastName;
public PremiumUser(String id, String firstName, String lastName){
this(firstName, lastName); = id;
public PremiumUser(String id, String firstName, String lastName, boolean isActive){…

Chamal Weerasinghe

Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store