Repository and Unit of work pattern in ASP.net core

Repository and Unit of work pattern in ASP.net core

A Repository is used to manage aggregate persistence and retrieval. The repository mediates between the data-access layer and the domain.The unit of work pattern keeps track of all changes to aggregates. Once all updates of the aggregates in a scope are completed, the tracked changes are played onto the database in a transaction

July 30, 2020 · (updated February 2, 2024) · 12 min · Pradeep Loganathan

How do you increment a counter? -

Many moons ago I was working on an online eCommerce platform. The platform used to undergo massive traffic spikes periodically. I was trying to implement a distributed counter. I was using a distributed counter because I wanted to be able to increment the counter on multiple servers. CAP Theorem The CAP theorem was proposed by Eric Brewer. CRDT CRDT stands for conflict-free replicated datatype. Conflict-free replicated datatype describe data-types that can be replicated across multiple computation units or nodes, they can be updated concurrently without any coordination, and then merged to get a consistent state....

September 2, 2019 · (updated March 7, 2022) · 3 min · Pradeep Loganathan

Service Mesh

Imagine a green, sustainable city, meticulously designed for environmental harmony and efficiency. The city has many distinct localities such as neighborhoods, districts, and even villages with their own identity and cultures. This city boasts an intricate public transport system, with buses, trams, and subways efficiently transporting citizens to their destinations from its various localities. Multiple such cities are connected together in a thriving, fast-paced ecosystem. The cities are also similarly connected in an efficient and sustainable design....

July 24, 2019 · (updated November 17, 2023) · 4 min · Pradeep Loganathan

Sidecar container pattern

Sidecar pattern is a single-node pattern made up of two containers. It involves co-locating another container in a node/pod along with the main application container. The application container contains the core logic for the application. The role of the sidecar is to augment and improve the application container, often without the application container’s knowledge. In its simplest form, a sidecar container can be used to add functionality to a container that might otherwise be difficult to add....

July 24, 2019 · (updated November 30, 2023) · 3 min · Pradeep Loganathan
Transactional Outbox Pattern

Transactional Outbox Pattern

Transactional Outbox is a pattern to reliably publish messages without the use of distributed transactions. It uses an Outbox and a message dispatcher to reliably persist state and publish messages.

July 16, 2019 · (updated February 5, 2024) · 10 min · Pradeep Loganathan
Idempotent Consumer Pattern

Idempotent Consumer Pattern

The Idempotent Consumer pattern provides the necessary safeguards to allows logic wrapped by it to be executed only once. It implements an unique identifier for each message and an idempotent repository.

July 6, 2019 · (updated January 31, 2024) · 5 min · Pradeep Loganathan
API Gateway - Should you build one?

API Gateway - Should you build one?

An API Gateway provides a single and unified API entry point across one or more internal APIs. It mediates, routes, and invokes a respective endpoint after request verification, content filtering, authentication, and authorization.

January 15, 2019 · (updated February 2, 2024) · 6 min · Pradeep Loganathan
Circuit Breaker pattern

Circuit Breaker Pattern

Circuit breakers help to avoid one failing component tearing down other dependent services in a domino effect. The key idea is for a service to fail fast if a dependent resource is not available, as opposed to waiting for a timeout/error for each service invocation during the period in which the dependent resource is down.

September 21, 2018 · (updated December 25, 2023) · 4 min · Pradeep Loganathan
Reactive Manifesto

Reactive Manifesto

The Reactive Manifesto describes how to design and architect Reactive systems according to your needs.Systems built as Reactive Systems are more Reliable, flexible, loosely coupled, scalable and resilient. This makes them easier to develop and amenable to change. Reactive systems are more tolerant of failure and when failure does occur, they meet it with elegance rather than disaster.

September 9, 2018 · (updated December 5, 2023) · 6 min · Pradeep Loganathan

Retry Pattern

The retry pattern is an extremely important pattern to make applications and services more resilient to transient failures. A transient failure is a common type of failure in a cloud-based distributed architecture. This is often due to the nature of the network itself (loss of connectivity, timeout on requests, and so on). Transient faults occur when services are hosted separately and communicate over the wire, most likely over a HTTP protocol....

August 10, 2018 · (updated August 31, 2022) · 3 min · Pradeep Loganathan