BLOGS

Thoughts on backend engineering, systems, and craft.

Deep dives from real production experience — SQL compilers, AI pipelines, system design, and competitive programming.

S
Backend Engineering
Featured

Spring Boot JWT Authentication: Complete Guide

A production-ready JWT auth setup in Spring Boot — filter chain, token validation, refresh tokens, and the common mistakes that make your API insecure.

JavaSpring BootSpring Security
Jun 15, 20258 min
M
DSA

Mastering the Two Pointers Pattern in Java

Two pointers is one of the most versatile DSA patterns. Here's every variant — opposite ends, fast-slow, and multi-array — with Java solutions and when to reach for each.

DSAJavaLeetCode
Jun 8, 20256 min
S
System Design

System Design: URL Shortener Like bit.ly

Designing a URL shortener end-to-end — Base62 encoding, hash collisions, database choice, caching layer, and how to handle 100M+ URLs at scale.

System DesignRedisPostgreSQL
Jun 2, 20259 min
J
Backend Engineering
Featured

JPA N+1 Problem: How to Find and Fix It in Spring Boot

The N+1 query problem silently kills performance in Spring Boot apps. Here's how to detect it with Hibernate stats, and three strategies to eliminate it — JOIN FETCH, @EntityGraph, and projections.

JavaSpring BootJPA
May 22, 20257 min
R
System Design

Rate Limiter Design: Token Bucket vs Leaky Bucket vs Sliding Window

Designing a rate limiter from scratch — three algorithms compared, Redis-based distributed implementation, and how Spring Boot API Gateway handles it in practice.

System DesignRedisSpring Boot
May 15, 20258 min
S
DSA

Sliding Window Pattern: From Easy to Hard

Sliding window is the go-to pattern for subarray and substring problems. Here's the fixed-size and variable-size templates, plus the counter trick that solves 'at most K' problems.

DSAJavaLeetCode
May 8, 20256 min
D
Backend Engineering

Docker + Spring Boot: Production-Ready Setup

From a naive 900MB image to a lean 180MB multi-stage build — Dockerfile best practices, environment config, health checks, and Docker Compose for local dev.

DockerSpring BootJava
May 2, 20257 min
B
DSA

Binary Search: Beyond Sorted Arrays

Most people use binary search only on sorted arrays. But the real power is binary search on the answer space — solving problems in O(log n) that look like they need O(n) or brute force.

DSAJavaLeetCode
Apr 20, 20256 min
R
Backend Engineering

Redis Caching with Spring Boot: Real-World Patterns

Beyond @Cacheable — TTL strategies, cache-aside vs write-through, cache warming, and how to handle cache invalidation without shooting yourself in the foot.

RedisSpring BootJava
Apr 10, 20257 min
S
System Design

System Design: Distributed Message Queue from Scratch

Designing a Kafka-like message queue — partitioning, consumer groups, offset management, at-least-once vs exactly-once delivery, and where each guarantee breaks down.

System DesignKafkaDistributed Systems
Apr 3, 202510 min
D
DSA

Dynamic Programming: 5 Patterns That Cover 80% of Problems

Stop memorizing DP solutions. Learn these 5 patterns and you'll recognize DP problems on sight — with Java implementations for each.

DSAJavaLeetCode
Mar 25, 20259 min
S
Backend Engineering

Spring Boot + Kafka: Event-Driven Architecture in Practice

How I wired Kafka into a Spring Boot microservice — configuration, serialization, error handling, retries, dead letter topics, and the pitfalls that bit me in production.

JavaSpring BootKafka
Mar 14, 20258 min
M
System Design

Microservices vs Monolith: When to Split and When Not To

After building both, here's my honest take — microservices are not always better. The decision framework I use, the hidden costs nobody talks about, and when a modular monolith wins.

System DesignMicroservicesArchitecture
Mar 5, 20257 min
G
DSA

Graph Algorithms You Need for Coding Interviews (Java)

BFS, DFS, Dijkstra, Union-Find, and topological sort — the templates and problem-recognition patterns you need to solve graph problems under interview pressure.

DSAJavaLeetCode
Feb 20, 20259 min
S
Backend Engineering

Spring Boot Exception Handling: The Right Way

Stop returning 500s with stack traces. Here's a clean, centralized exception handling setup using @ControllerAdvice, custom exceptions, and structured error responses.

JavaSpring BootREST APIs
Feb 10, 20255 min
D
System Design

Database Sharding: Strategies and Trade-offs

When a single DB instance isn't enough — horizontal sharding strategies, choosing a shard key, cross-shard queries, and the rebalancing problem nobody warns you about.

System DesignPostgreSQLDatabase
Feb 3, 20258 min
M
DSA

Monotonic Stack: The Pattern That Solves Histogram Problems

Monotonic stack is one of those patterns that looks magical until you understand the invariant it maintains. Next greater element, largest rectangle in histogram, daily temperatures — all solved with the same idea.

DSAJavaLeetCode
Jan 22, 20256 min
S
Backend Engineering

Spring Security: OAuth2 + SSO Integration Deep Dive

Wiring OAuth2 login, SSO with LinkedIn and Google, custom JWT issuance after OAuth handshake, and the session vs stateless trade-off you need to make early.

JavaSpring BootSpring Security
Jan 12, 20258 min
H
DSA

Heap and Priority Queue: Solving Top-K Problems in Java

PriorityQueue in Java, max-heap vs min-heap, the K closest points trick, merge K sorted lists, and finding the Kth largest element — patterns and templates.

DSAJavaLeetCode
Jan 5, 20256 min
J
Backend Engineering

Java Multithreading: CompletableFuture in Production

CompletableFuture patterns that actually appear in production code — parallel API calls, fan-out/fan-in, custom thread pools, timeout handling, and when to use Virtual Threads instead.

JavaMultithreadingCompletableFuture
Dec 18, 20248 min
S
System Design

System Design: Search Autocomplete at Scale

Designing Google-style search autocomplete — Trie data structure, prefix frequency ranking, caching layers, and how to serve 10,000 suggestions/sec with sub-50ms latency.

System DesignTrieRedis
Dec 8, 20249 min
S
Backend Engineering

Spring Boot Testing: Unit, Integration, and Slice Tests

A testing strategy that actually works — when to use @WebMvcTest vs @SpringBootTest, mocking with Mockito, testcontainers for real DB tests, and the test pyramid for Spring Boot.

JavaSpring BootTesting
Dec 1, 20247 min