Author: Editorial Team
-
Building Edge Server using Spring Cloud Gateway
In this tutorial, we’ll build an edge server using Spring Cloud Gateway. Dependency To create an edge server using Spring Cloud Gateway, following is the dependency: We’ll also need the spring-cloud-starter-netflix-eureka-client dependency as our gateway server is going to register with Eureka server. Following is our complete pom.xml: Configuration Following is the complete configuration file…
-
Composite pattern in Java
Introduction The Composite design pattern is a structural pattern used to treat individual objects and compositions of objects uniformly. It enables you to represent part-whole hierarchies, making it easier to work with tree-like structures. In this tutorial, we will explore the Composite pattern in Java with a detailed example and explanation. Key Concepts of Composite…
-
Flyweight pattern in Java
Introduction A flyweight is a shared object that can be used in multiple contexts simultaneously. The flyweight acts as an independent object in each context – it’s indistinguishable from an instance of the object that’s not shared. Flyweights cannot make assumptions about the context in which they operate. When you consider flyweight pattern, you need…
-
Rate Limiting Pattern
Introduction Many services implement throttling to regulate resource usage, restricting the rate at which applications or services can access them. By adopting a rate-limiting pattern, you can reduce or prevent throttling errors, manage these limits effectively, and predict throughput more accurately. This approach is particularly beneficial in scenarios involving large-scale, repetitive automated tasks, such as…
-
Facade Pattern in Java
Introduction Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use. Imagine a scenario where a system involves numerous objects collaborating to perform a series of tasks. Interacting directly with each object individually can be cumbersome and error-prone. A Facade acts…
-
Adapter Pattern
Introduction The Adapter Design Pattern is a structural design pattern that allows objects with incompatible interfaces to work together. Convert the interface of a class into another interface that clients expect. Adapter lets classes work together that could not otherwise because of incompatible interfaces. This design pattern acts as a bridge between two incompatible interfaces,…
-
Decorator pattern in Java
Introduction Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality. The Decorator Pattern is a structural design pattern that allows you to dynamically add behavior or responsibilities to an object without altering its structure. It is an alternative to subclassing and is often used to adhere to…
-
Sidecar pattern
Introduction Deploy components of an application into a separate process or container to provide isolation and encapsulation. This pattern can also enable applications to be composed of heterogeneous components and technologies. This pattern is named Sidecar because it resembles a sidecar attached to a motorcycle. In the pattern, the sidecar is attached to a parent application and…
-
Forward Proxy vs. Reverse Proxy
1. Forward Proxy Many businesses use proxy servers to route and secure traffic between networks. A proxy server, sometimes referred to as a forward proxy, is a server that routes traffic between client(s) and another system, usually external to the network. By doing so, it can regulate traffic according to preset policies, convert and mask…
-
Saga distributed transactions pattern
Introduction The Saga design pattern helps maintain data consistency in distributed systems by coordinating transactions across multiple services. A saga is a sequence of local transactions where each service performs its operation and initiates the next step through events or messages. If a step in the sequence fails, the saga executes compensating transactions to undo…
