Aggregator Microservices

Intent

The user makes a single call to the aggregator service, and the aggregator then calls each relevant microservice.

Explanation

Real world example

Our web marketplace needs information about products and their current inventory. It makes a call to an aggregator service which in turn calls the product information microservice and product inventory microservice returning the combined information.


iluwatarArchitecturalCloud distributedDecouplingMicroservicesAbout 1 min
Ambassador

Intent

Provide a helper service instance on a client and offload common functionality away from a shared resource.

Explanation

Real world example

A remote service has many clients accessing a function it provides. The service is a legacy application and is impossible to update. Large numbers of requests from users are causing connectivity issues. New rules for request frequency should be implemented along with latency checks and client-side logging.


iluwatarStructuralDecouplingCloud distributedAbout 2 min
API Gateway

Intent

Aggregate calls to microservices in a single location, the API Gateway. The user makes a single call to the API Gateway, and the API Gateway then calls each relevant microservice.

Explanation

With the Microservices pattern, a client may need data from multiple different microservices. If the client called each microservice directly, that could contribute to longer load times, since the client would have to make a network request for each microservice called. Moreover, having the client call each microservice directly ties the client to that microservice - if the internal implementations of the microservices change (for example, if two microservices are combined sometime in the future) or if the location (host and port) of a microservice changes, then every client that makes use of those microservices must be updated.


iluwatarArchitecturalCloud distributedDecouplingMicroservicesAbout 3 min
Balking

Intent

Balking Pattern is used to prevent an object from executing a certain code if it is in an incomplete or inappropriate state.

Explanation

Real world example

There's a start-button in a washing machine to initiate the laundry washing. When the washing machine is inactive the button works as expected, but if it's already washing the button does nothing.


iluwatarConcurrencyDecouplingAbout 2 min
Business Delegate

Intent

The Business Delegate pattern adds an abstraction layer between presentation and business tiers. By using the pattern we gain loose coupling between the tiers and encapsulate knowledge about how to locate, connect to, and interact with the business objects that make up the application.


iluwatarStructuralDecouplingAbout 2 min
Circuit Breaker

Intent

Handle costly remote service calls in such a way that the failure of a single service/component cannot bring the whole application down, and we can reconnect to the service as soon as possible.

Explanation

Real world example

Imagine a web application that has both local files/images and remote services that are used for fetching data. These remote services may be either healthy and responsive at times, or may become slow and unresponsive at some point of time due to variety of reasons. So if one of the remote services is slow or not responding successfully, our application will try to fetch response from the remote service using multiple threads/processes, soon all of them will hang (also called thread starvation) causing our entire web application to crash. We should be able to detect this situation and show the user an appropriate message so that he/she can explore other parts of the app unaffected by the remote service failure. Meanwhile, the other services that are working normally, should keep functioning unaffected by this failure.


iluwatarBehavioralPerformanceDecouplingCloud distributedAbout 5 min
Converter

Intent

The purpose of the Converter pattern is to provide a generic, common way of bidirectional conversion between corresponding types, allowing a clean implementation in which the types do not need to be aware of each other. Moreover, the Converter pattern introduces bidirectional collection mapping, reducing a boilerplate code to minimum.


iluwatarCreationalDecouplingAbout 1 min
Currying

Name / classification

Currying

Intent

Currying decomposes a function that takes multiple arguments into a sequence of functions that each take a single argument. Curried functions are useful since they can be used to create new functions with lower arity to perform more specialised tasks in a concise and readable manner. This is done via partial application.


iluwatarFunctionalDecouplingAbout 4 min
Data Bus

Intent

Allows send of messages/events between components of an application without them needing to know about each other. They only need to know about the type of the message/event being sent.

Explanation

Real world example

Say you have an app that enables online bookings and participation of events. You want the app to send notifications such as event advertisements to everyone who is an ordinary member of the community or organisation holding the events. However, you do not want to send such notifications like advertisements to the event administrators or organisers but you desire to send them and them only the time whenever a new advertisement is sent to all members of the community. The Data Bus enables you to selectively notify people of a community by type, whether it be ordinary community members or event administrators, by making their classes or components only accept messages of a certain type. Ultimately, there is no need for the components or classes of ordinary community members nor administrators to know anything about you in terms of the classes or components you are using to notify the entire community except for the need to know the type of the messages you are sending.


iluwatarArchitecturalDecouplingAbout 3 min
Data Mapper

Intent

Data Mapper is the software layer that separates the in-memory objects from the database. Its responsibility is to transfer data between the objects and database and isolate them from each other. If we obtain a Data Mapper, it is not necessary for the in-memory object to know if the database exists or not. The user could directly manipulate the objects via Java command without having knowledge of SQL or database.


iluwatarArchitecturalDecouplingAbout 3 min
2
3
4