Microservice Design Patterns (Part — 03)

The proxy microservice design pattern is slightly similar to the aggregator. But according to the proxy design pattern, we do not need an aggregator on the consumer, but we create a microservice to invoke other services based on the business requirements. Let’s understand the proxy pattern with the below example.

Example:

▪ ️Assume your company currently having a monolithic application. So now you need to move to microservice architecture. So when you are deploying microservices maybe you need to change the services.

▪️ Consider, you have a microservice to get the leave information of…


(Microservice Design Patterns — Part- 02)

If your house is powered by electricity, then you can find a circuit breaker. So when you get the power from the main grid, the power always comes through a circuit breaker. If the main grid behaves in an abnormal way, or if additional power tries to come, then that circuit breaker will go off and the internal power system of the house will be protected. So this scenario is much similar to the “Circuit Breaker Design Pattern”.

Why we need the Circuit Breaker Design Pattern? 🧐

In a distributed system, there are many services that interact with each other. So the possibility…


(Design Patterns— Part- 01)

📍 Before going into the design patterns, first, we should understand the principles behind them. So below are some principles which were used to design Microservices.

▪️ Availability

▪️ Resilient Services

▪️ Isolation from Failures

▪️ Scalability and Auto Provisioning

▪️ Autonomous Services

▪️ Independent

Why we need design patterns for microservices? 🧐

📍 The design patterns in Microservices are the software design patterns that produce autonomous services which are reusable (Because when the solutions to an issue are well known, then we can apply them to the same kind of issues in the future)and helps to overcome the common problems and challenges that…


Microservices: Best Practices ✨

In this article, I’m going to discuss nine best practices that you should follow when dealing with microservices.

① Always consider using Domain-Driven Design.

✹ It should have a well-defined scope. Consider the below example,

Example:

Assume that there’s a “Rent a car” application. There’s a customer and it can represent two different services but from two different aspects. Consider those as Customer Registration and Support service. Hence the same customer is involved for both modules but in two different aspects. If we consider the Support service, the main purpose/domain of this module is customer support.

So accordingly we should have a…


An Overview of Microservice Architecture

Monolithic Architecture

What we have today is called Monolithic Applications. These are built as a single, unified unit, or in other terms, we can say that the monolithic applications have a single executable file for your entire application (The entire application is packed into one file).


A simple overview of Docker and Container-based development.

Generation — 01

📍 Early days we deployed our applications using physical servers.

Example: Assume there is an application, database, and web server. Accordingly in those days, we used three different physical hardware boxes for this purpose.

Problems with those different hardware boxes 🧐

Have to maintain them.(If there were multiple servers, then we need muliple people to maintain it.)

Need more space.

Need seperate network.

Need seperate opertaing system.

High cost.

Waste (As the application server/ web server is not using100% of processing power and the memory of the box, And the database server is not using100% of the space of…


New features in ES6 every developer must know 📝

Special features of modern JavaScript

📍 JavaScript can be defined as a very powerful programming language and it is actually based on ECMA script. (ECMA is the foundation and javascript is on top of that)

📍 JavaScript ES6 is also called ECMAScript 6 or ECMAScript 2015 And this was introduced in 2015 as a new version of JavaScript.

In this article, I'm going to discuss the below topics:

1. Scope

2. Constants

3. Arrow Function

4. Function and Arrow Function

5. Handling Objects

6. Freeze method

7. Template

8. Classes

9. Destructuring

10. JavaScript Callback Function…


An overview of the Memento Design Pattern and its implementation with a real-world scenario!

📍 According to the book “Design Patterns: Elements of Reusable Object-Oriented Software” by a gang of four, the Memento Desing Pattern belongs to the category of behavioral design patterns and, also known as snapshot pattern.

📍 The Memento is a design pattern was designed to restore an object to its previous state.

Consider the below technical examples where we use the Memento Design Pattern

🌞 You have been using the Microsoft Word to do your work and have you ever seen an undo feature there🧐 By clicking the undo option you can go to your previous states.

🌞…


An overview of the Chain of Responsibility design pattern & its implementation with a real-world scenario!

📍 Chain of Responsibility Design Pattern is a Behavioral design pattern.

📍 The chain of responsibility pattern is mostly used to pass the responsibility to the next if the current object cannot handle it at the moment. By utilizing this Chain of Responsibility Design Pattern, you can accomplish the loose coupling.

Let’s understand this design pattern with the below example:

Assume that you need to control a menu on the user level. There you have the CEO, Director, Manager, and the Executives. So accordingly each of them has multiple levels of permissions. …


📍 The Builder Design Pattern comes under the creational design pattern.

📍 The Builder Design Pattern deals with tackle the problems with the creation of objects due to complicated multiple constructors.

📍 Sometimes we need to use multiple constructors in our program. Think of the below example➜

Assume that you have a “Vehicle” class in a Rent a Car system. So when someone rents out a vehicle, you need to give insurance, road assistance, emergency assistance, highway electric pass, and so on. So depend on those features, and as there are multiple combinations, you may have to create multiple constructors.

Irushinie Muthunayake

Associate Software Engineer at Virtusa

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