https://www.gravatar.com/avatar/8b70c88c0fa009dcea72cf30ea9190d0?s=240&d=mp

Postgres

Core Architecture

Process Model (Postmaster, Backends, Background Workers)

PostgreSQL uses a multi-process architecture for stability and isolation. The Postmaster (also called the postgres daemon) is the parent process that starts when the database server is launched. The Postmaster initializes shared memory and launches essential background processes on startup. It listens for client connection requests; when a new client connects, the Postmaster forks a new backend process& dedicated to that session. In other words, each database connection is handled by its own client backend process, providing isolation (a crash in one backend does not crash others) at the cost of some overhead. All these processes are visible in the OS process table (on Unix systems, the postgres processes form a tree under the Postmaster). severalnines.com

Kafka Cluster

1. Introduction

  • Motivation for Kafka

    • Rise of event-driven architectures
    • Big data & real-time processing needs
  • What is Apache Kafka?

    • History and evolution (LinkedIn → Apache project)
    • Core principles: distributed log, publish-subscribe, scalability
  • Research Objectives

    • Understand Kafka cluster internals
    • Compare with alternatives (RabbitMQ, Redis Streams, etc.)
    • Explore use cases in modern data platforms

2. Kafka Fundamentals

Kafka as a Distributed Commit Log

Mental model: an append-only file, sharded into partitions, replicated across brokers. Producers append, consumers read by offset.

Redis

Core Redis Archtecture

Process Model (Single-threaded Core)

Redis using single-threaded event loop for command processing. It’s extremely fast because:

  • No locks -> no thread contention.
  • Uses I/O multiplexing (epoll/kqueue) to handle thousands of client connections.
  • Heavy wrok (AOF rewrite, RDB save) offloaded to background processses.

📌 Key insight: Redis trades CPU parallelism for predictable latency and simplicity.

Data Structures (In-Memory Storage)

Redis isn’t just key-value store: it provides specialized data structures. Each is optimized for memory and speed.

Resilience & Distributed Design Patterns

Resilience patterns are essential for building fault-tolerant distributed systems that gracefully handle failures, network issues, and service degradation. These patterns prevent cascading failures and ensure system availability even when individual components fail. designgurus codecentric circuit-breaker-bulkhead-retries

Circuit Breaker

The Circuit Breaker pattern prevents cascading failures by failing fast when a service is unavailable, protecting system resources from exhaustion.

How It Works

The circuit breaker monitors failure rates and operates in three states: Closed (normal operation), Open (blocking requests), and Half-Open (testing recovery). ijirmps.org

Design Pattern

Creational Design Patterns:

What are Creational Design Patterns?

Creational patterns focus on how objects are created, making the system independent of how its objects are created, composed, and represented. They solve problems that arise when basic object creation could result in design problems or added complexity due to inflexible creation procedures. geeksforgeeks The five main creational patterns are:

  • Singleton - Ensures only one instance exists
  • Factory Method - Creates objects through subclasses
  • Abstract Factory - Creates families of related objects
  • Builder - Constructs complex objects step-by-step
  • Prototype - Creates objects by copying existing instances

Singleton Pattern

Structure and Implementation

/design-pattern/singleton-db-management.png Factory Method Pattern - Payment Processing System Structure

Architecture styles

Software architecture patterns provide proven structural solutions for organizing applications to achieve scalability, maintainability, and testability. Understanding these patterns enables architects to make informed decisions about system design based on specific business requirements and technical constraints. github clustox.com

Layered Architecture

Layered Architecture organizes an application into horizontal layers where each layer has a distinct responsibility and communicates only with adjacent layers. dev.to

Core Layers

The traditional layered architecture consists of four primary layers: