Skip to main content
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.


iluwatarAbout 1 minArchitecturalCloud distributedDecouplingMicroservices
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.


iluwatarAbout 2 minArchitecturalCloud distributedDecouplingMicroservices
Client Session Pattern

Name

Client Session pattern

Intent

  • Create stateless servers that removes the problem of clustering, as users can switch between servers seamlessly.
  • Makes data more resilient in case of server fail-over.
  • Works well with smaller data sizes.

iluwatarAbout 2 minArchitecturalDecoupling
CQRS

Intent

CQRS Command Query Responsibility Segregation - Separate the query side from the command side.

Class diagram

CQRS

Applicability

Use the CQRS pattern when

  • You want to scale the queries and commands independently.
  • You want to use different data models for queries and commands. Useful when dealing with complex domains.
  • You want to use architectures like event sourcing or task based UI.

iluwatarLess than 1 minuteArchitecturalPerformanceCloud distributed
Data Access Object

Intent

Object provides an abstract interface to some type of database or other persistence mechanism.

Explanation

Real world example

There's a set of customers that need to be persisted to database. Additionally we need the whole
set of CRUD (create/read/update/delete) operations so we can operate on customers easily.


iluwatarAbout 2 minArchitecturalData access
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.


iluwatarAbout 3 minArchitecturalDecoupling
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.


iluwatarAbout 3 minArchitecturalDecoupling
Data Transfer Object

Intent

Pass data with multiple attributes in one shot from client to server, to avoid multiple calls to
remote server.

Explanation

Real world example

We need to fetch information about customers from remote database. Instead of querying the
attributes one at a time, we use DTOs to transfer all the relevant attributes in a single shot.


iluwatarAbout 1 minArchitecturalPerformance
Domain Model

Intent

Domain model pattern provides an object-oriented way of dealing with complicated logic. Instead of having one procedure that handles all business logic for a user action there are multiple objects and each of them handles a slice of domain logic that is relevant to it.

Explanation


iluwatarAbout 4 minArchitecturalDomain
Event Driven Architecture

Intent

Send and notify state changes of your objects to other applications using an Event-driven Architecture.

Class diagram

Event Driven Architecture

Applicability

Use an Event-driven architecture when

  • you want to create a loosely coupled system
  • you want to build a more responsive system
  • you want a system that is easier to extend

iluwatarLess than 1 minuteArchitecturalReactive
2
3