Posts

Showing posts with the label architecture pattern

Idempotency

Image
Intent Idempotency , or idempotence , is a mesmerising word the first time you come across it. It is a concept rooted from abstract algebra in mathematics. Even though it may help understanding from a mathematical perspective, idempotency can be simply put as: The net result of multiple applications of the same method remains the same. Why is idempotency important, or relevant at all for RESTful APIs ? First, let us start by inspecting a real world example. Imagine an online payment scenario, the website suddenly becomes unresponsive and you have no idea if the payment you just made was successful or not. The temptation is to keep pressing the payment button, despite being advised not to. Soon you will find yourself swarmed by deliveries and a long bill.  Because networks are fundamentally unreliable in a distributed world , disruptions to connections will happen. In the circumstances that an API consumer sends a request but is unable to receive a response, it is impossible for the...

Scaling Services with Stateful Event Flow

Image
Intent Modern services are designed to be stateless, meaning a server processes requests only based on the information provided without having to rely on information from earlier requests. This is the ideal scenario but real-life processing flows do not always comply with that principle, such as: There are more than one processing server available to process an event flow that relies on the knowledge of previous executions; Scaling up server instances amid processing of large volumes of events; Use of sharding architecture; All this requires a stateful approach to routing so that the API calls and events  contain sufficient data with each request to ensure proper routing and application behaviour. This is required to maintain the lineage of the flow to prevent: accidental loss of information; or worse,  race conditions due to the events being processed in the wrong order by different instances of service.  Following are some approaches for mitigation. Sticky Session Load ...

Zero Trust Architecture

Image
Intent Zero Trust , meaning “ never trust, always verify ” ( Samaniego & Deters, 2018, p. 89 ), is an approach to secure digital assets by eliminating implicit trust and requiring strict verification when trying to access resources. No user or application is trusted by default from inside or outside the network, and verification is always required from everyone trying to gain access to resources on the network. This added layer of security has been shown to prevent data breaches. IBM Studies have shown that the average cost of a single data breach is over $3 million . Zero Trust Security was first established at large internet firms such as Google and CloudFlare , and it is starting to gain traction with the rest of industries and corporations. Zero Trust Architecture (ZTA) is designed to protect modern environments and enable digital transformation by using strong authentication methods. Motivations There are a number of internal reasons why ZTA has become increasingly critica...