Builder Pattern for Objects with Many Parameters in Java
How to use Builder Pattern to create objects with many parameters in a readable, immutable way with validation—from manual implementation to Lombok @Builder and records.
Design patterns, system design, microservices and the building blocks of large systems.
How to use Builder Pattern to create objects with many parameters in a readable, immutable way with validation—from manual implementation to Lombok @Builder and records.
Understand and implement two popular caching strategies: cache-aside and write-through, plus how to choose an appropriate TTL in Spring Boot 3.
Understand how Kafka divides partitions among consumer groups, when rebalancing occurs, and how to reduce rebalancing impact in Spring Boot applications.
Case study on file storage system design: requirements, data model, chunked upload API, sharing, sync, conflict handling, and burst traffic.
Case study on designing a real-time order tracking and shipper location system using Spring Boot, Kafka, Redis GEO, and SSE. Article analyzes concurrency, consistency, and load spikes.
Case study on discount code system design: preventing over-issuance during flash sales using atomic UPDATE, Redis Lua, Kafka, and time-limited reservations.
Case study of auction system design: data model, API, concurrent bid handling with conditional updates, Redis Lua, anti-sniping, and safe session closure.
How to implement distributed locks using SET NX PX and Lua scripts, using Redisson with watchdog, writing tests with Testcontainers, and avoiding common pitfalls.
How to use the Saga pattern to maintain data consistency across multiple microservices without 2PC, with Java 21 orchestration examples and tests.
Learn how PostgreSQL handles transactions, four isolation levels, phenomena like lost update and write skew, and how to configure and retry in Spring Boot.
Use Bloom filter on Redis (via Redisson) to block requests querying non-existent keys before they penetrate the cache and hit the database.
Use Debezium to read PostgreSQL's WAL, push every data change to Kafka and consume them with Spring Boot, without modifying the data writing code.
Case study for 1-1 and group chat design. Using seq-based data model, idempotent send API, watermark-based read state, outbox + Kafka, and handling traffic spikes.
Case study designing a subscription billing system covering data model, APIs, renewal flow, preventing double charging, outbox pattern with Kafka and handling traffic spikes.
Case study designing a concert ticket system handling traffic spikes. The article covers building a virtual queue on Redis, atomic seat holds with SQL, and idempotent payment handling.
News feed design case study: requirements, scale, data model, API, comparing fan-out on write vs read, hybrid model, handling celebrities, consistency, and traffic spikes.
Case study on designing a medical appointment booking system with slot models, APIs, preventing double bookings using conditional updates and unique indexes, and handling burst load at slot release time.
Case study on building a notification system for push, email, and SMS: data model, idempotent APIs, outbox pattern, priority queues, exponential backoff retry, and handling traffic spikes.
Case study on designing a distributed rate limiter for an API gateway, covering requirements, algorithm selection, data models, Lua scripts on Redis, and handling race conditions, traffic spikes, and outages.
Case-study designing a fraud scoring system under 50ms. This article covers requirements, data model, API, Redis velocity check, idempotency, outbox with Kafka, and handling burst load.