Bulkhead Pattern It isolates different parts of a system so that failure in one component does not affect others. Each service or group of services operates in its own compartment,” similar to ship bulkheads.
Improves system resilience by containing failures within a single service or module. Ensures stability in applications like streaming platforms, where a failure in recommendations won’t affect video playback or user management. Implementation:
Semaphore Bulkhead (Lightweight): Limits the number of concurrent calls using a simple counter (Semaphore).
What is a thread? A thread is a lightweight subprocess. It is a separate path of execution because each thread runs in a different stack frame. A process may contain multiple threads. Threads share the process resources, but still, they execute independently.
How to implement threads?
Implementing the Runnable interface Extending the Thread class When to Use Which?
Use extends Thread: if your class does not extend any other class. Use implements Runnable: if your class already extends another class (preferred because Java doesn’t support multiple inheritance).
What is it? Kubernetes, also known as K8s, is an open-source system for automating the deployment, scaling, and management of containerized applications. (Orchestration tool)
Features High availability Scalability (horizontal) and performance Disaster recovery Self healing Automated rollbacks Can run on-prem, cloud or hybrid environment Drawbacks High complexity Upfront costs are high and can be costly High level of expertise and resouces needed to deploy and manage Info Managed kuberenetes engines like Amazon EKS, Google kubernetes engine and Azure kubernetes service take care of underlying infrastructure, setting up, configure control plane, scaling the cluster and maintenance support.
Lambda Expressions Lambda expressions are used to write concise, functional-style code by representing anonymous functions. They enable passing code as parameters or assigning it to variables, resulting in cleaner and more readable programs.
Lambda expressions implement a functional interface Enable passing code as data (method arguments). Allow defining behavior without creating separate classes. interface Add { int addition(int a, int b); } public class Test { public static void main(String[] args){ Add add = (a, b) -> a + b; int result = add.
SOAP (Simple Object Access Protocol) A veteran, mature, and comprehensive protocol primarily based on XML.
Characteristics: Rigid, verbose, and strictly XML-based. Best For: Financial services and payment gateways where high security and reliability are non-negotiable. Drawbacks: Excessive complexity and overhead; unsuitable for lightweight mobile apps or quick prototypes. REST (Representational State Transfer) The most popular style, acting as the “internet backbone” for most web applications.
Characteristics: Built on standard HTTP methods; easy to implement, cacheable, and highly scalable.